Darryl L. Pierce
2009-Jan-13 22:33 UTC
[Ovirt-devel] [PATCH node] Changed max swap size to allow for overcommitting.
If the ovirt_overcommit kernel argument is passed, the value supplied will override the default value, which is 2GB. Signed-off-by: Darryl L. Pierce <dpierce at redhat.com> --- scripts/ovirt-config-storage | 3 +-- scripts/ovirt-early | 14 +++++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage index b3d87ae..71e5575 100755 --- a/scripts/ovirt-config-storage +++ b/scripts/ovirt-config-storage @@ -289,8 +289,7 @@ MEM_SIZE=$(cat /proc/meminfo | awk '/MemTotal:/ { print $2 }') case $MEM_SIZE in ''|*[^0-9]*) die failed to get system memory size;; esac - -MEM_SIZE=$(echo "scale=0; m=($MEM_SIZE / 1024 * 2); if (m < 2048) { m } else { 2048 }" | bc -l) +MEM_SIZE=$(echo "scale=0; m=($MEM_SIZE / 1024 * 2); if (m < ${OVIRT_OVERCOMMIT}) { m } else { ${OVIRT_OVERCOMMIT} }" | bc -l) SWAP_SIZE=${OVIRT_VOL_SWAP_SIZE:-$MEM_SIZE} BOOT_SIZE=${OVIRT_VOL_BOOT_SIZE:-$default_boot_size} diff --git a/scripts/ovirt-early b/scripts/ovirt-early index 153c0c7..9031ad8 100755 --- a/scripts/ovirt-early +++ b/scripts/ovirt-early @@ -117,6 +117,7 @@ start() { # BOOTIF=link|eth*|<MAC> (appended by pxelinux) # ovirt_init=usb|scsi[:serial#] # ovirt_vol=BOOT_MB:SWAP_MB:ROOT_MB:CONFIG_MB:LOGGING_MB + # ovirt_overcommit # ovirt_local_boot # ovirt_standalone # pxelinux format: ip=<client-ip>:<boot-server-ip>:<gw-ip>:<netmask> @@ -156,6 +157,11 @@ start() { # install/update oVirt Node image on the local installation target disk local_boot=0 + # ovirt_overcommit + # set the overcommit size for the swap partition, in megabytes + # default is 2204 maximum + overcommit=2048 + # ovirt_standalone # force oVirt Node standalone mode standalone=0 @@ -245,6 +251,12 @@ start() { standalone=1 bootparams="$bootparams $i" ;; + + ovirt_overcommit*) + i=${i#ovirt_overcommit=} + eval $(printf $i|awk -F: '{print "overcommit="$1;}') + ;; + ip=*) i=${i#ip=} eval $(printf $i|awk -F: '{print "ip_address="$1; print "ip_gateway="$3; print "ip_netmask="$4}') @@ -278,7 +290,7 @@ start() { ip_gateway=$gateway fi # save boot parameters as defaults for ovirt-config-* - params="bootif init vol_boot_size vol_swap_size vol_root_size vol_config_size vol_logging_size local_boot standalone ip_address ip_netmask ip_gateway ipv6 syslog_server syslog_port bootparams hostname" + params="bootif init vol_boot_size vol_swap_size vol_root_size vol_config_size vol_logging_size local_boot standalone overcommit ip_address ip_netmask ip_gateway ipv6 syslog_server syslog_port bootparams hostname" mount_config if [ -e $OVIRT_DEFAULTS ]; then echo "update ovirt defaults" -- 1.6.0.6
Alan Pevec
2009-Jan-13 23:58 UTC
[Ovirt-devel] [PATCH node] Changed max swap size to allow for overcommitting.
On Tue, Jan 13, 2009 at 11:33 PM, Darryl L. Pierce <dpierce at redhat.com>wrote:> If the ovirt_overcommit kernel argument is passed, the value supplied > will override the default value, which is 2GB. >nack - that's too easy :) lemme try to explain what I had in mind: parameter should accept the overcommit ratio as its value and not max. size in MB - otherwise admin needs to adjust it for different machines ovirt_overcommit=N means swap area is set to N * MEM_SIZE default N is 2, in case parameter is not present special case N=0, means overcommit is not used and swap area is set to min. required size from the table in http://kbase.redhat.com/faq/docs/DOC-15252 MEM_SIZE SWAP_SIZE <=4GB 2GB 4GB to 16GB 4GB 16GB to 64GB 8GB 64GB to 256GB 16GB -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/ovirt-devel/attachments/20090114/eaa69fde/attachment.htm>