[fedora-virt] [PATCH] memory taken by zero qemu processes should be 0

Justin M. Forbes jmforbes at linuxtx.org
Thu Aug 26 16:43:01 UTC 2010


On Thu, 2010-08-26 at 11:23 +0300, Dan Kenigsberg wrote:
> Former code behaved badly when `pgrep qemu` was empty.
> 
> Thanks to lihuang of BZ#609016
> ---
>  ksmtuned |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/ksmtuned b/ksmtuned
> index 205ff84..d5d1494 100644
> --- a/ksmtuned
> +++ b/ksmtuned
> @@ -71,8 +71,8 @@ KSMCTL () {
>  committed_memory () {
>      # calculate how much memory is committed to running qemu processes
>      local progname
> -    progname=${1:-qemu}
> -    ps -o vsz `pgrep $progname` | awk '{ sum += $1 }; END { print sum }'
> +    progname=${1:-qemu-kvm}
> +    ps -C "$progname" -o rsz | awk '{ sum += $1 }; END { print sum }'
>  }
>  
>  free_memory () {

Applied upstream. Will make the next Fedora packages.

Thanks



More information about the virt mailing list