Hide Forgot
+++ This bug was initially created as a clone of Bug #1012604 +++ Description of problem: This time around ksmtuned doesn’t find qemu processes when set_process_name in /etc/libvirt/qemu.conf is NOT changed from the default 0. This is because qemu was recently changed to incorporate qemu-kvm, and the qemu-kvm program now just exec-s the respective qemu-system-* binary with the right arguments. The process list will therefore show only qemu-system-* processes as representing the VMs. With ksmtuned looking for processes of either "qemu-kvm" or "qemu:something" (with "something" being the respective VM name, as it happens when set_process_name=1), these qemu-system-* processes will slip through. Version of selected components: ksm-1.4.2-9.fc19.x86_64 qemu-system-x86-1.4.2-9.fc19.x86_64 Additional info: There doesn’t seem to exist a functional specification as to which qemu processes ksmtuned should take into account, i.e. only those started by libvirt or also those started by other means, and by what criteria is should apply to tell them apart. However, to find qemu-system.* processes in addition to all those that were previously found, the regexp on line 74 of ksmtuned can simply be changed to read ^qemu(-(kvm|system-.+)|:.{1,11})$ --- Additional comment from Cole Robinson on 2013-10-31 16:24:25 EDT --- Thanks for the suggestion and bug report, moving to POST since there's a fix --- Additional comment from Fedora Update System on 2013-11-05 20:26:55 EST --- qemu-1.4.2-13.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/qemu-1.4.2-13.fc19 here's the diff we applied in fedora (fixes another bug as well): diff --git a/ksmtuned b/ksmtuned index c96507c..7bc5743 100644 --- a/ksmtuned +++ b/ksmtuned @@ -71,10 +71,10 @@ KSMCTL () { committed_memory () { # calculate how much memory is committed to running qemu processes local pidlist - pidlist=$(pgrep -d ' ' -- '^qemu(-kvm|:.{1,11})$') + pidlist=$(pgrep -d ' ' -- '^qemu(-(kvm|system-.+)|:.{1,11})$') if [ -n "$pidlist" ]; then ps -p "$pidlist" -o rsz= - fi | awk '{ sum += $1 }; END { print sum }' + fi | awk '{ sum += $1 }; END { print 0+sum }' } free_memory () {
This patch is not needed for RHEL 7 as it uses qemu-kvm binary and no qemu-system-* is present.
Reopen and rename. As we have problem with set_process_name=1 and need fix introduce to fedora with bz 955230 (that cause problem fixed with bz 1012604). Patch: committed_memory () { # calculate how much memory is committed to running qemu processes - local progname - progname=${1:-qemu-kvm} - ps -C "$progname" -o rsz | awk '{ sum += $1 }; END { print sum }' + local pidlist + pidlist=$(pgrep -d ' ' -- '^qemu(-kvm|:.{1,11})$') + if [ -n "$pidlist" ]; then + ps -p "$pidlist" -o rsz= + fi | awk '{ sum += $1 }; END { print sum }' } free_memory () {
*** Bug 976336 has been marked as a duplicate of this bug. ***
Verified on qemu-kvm-1.5.3-30.el7.x86_64: #/usr/sbin/ksmtuned committed_memory () { local pidlist pidlist=$(pgrep -d ' ' -- '^qemu(-kvm|:.{1,11})$') if [ -n "$pidlist" ]; then ps -p "$pidlist" -o rsz= fi | awk '{ sum += $1 }; END { print 0+sum }' } Patch applied, just in bug 1027418, there is update: - fi | awk '{ sum += $1 }; END { print sum }' + fi | awk '{ sum += $1 }; END { print 0+sum }' Verified.
This request was resolved in Red Hat Enterprise Linux 7.0. Contact your manager or support representative in case you have further questions about the request.