Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Cause:
Incorrect value has been used to calculate qemu-kvm memory usage (and turn on KSM).
Consequence:
KSM (Kernel Samepage Merging) turned on too early.
Fix:
Use real memory size instead of virtual memory size for calculating qemu-kvm memory usage.
Result:
Turning on KSM is more optimized
Description of problem:
In ksmtuned there's this line:
ps -C "$progname" -o vsz= | awk '{ sum += $1 }; END { print sum }'
"vsz" in not a good way to estimate the mem usage, this line makes KSM turn on way too early.
Version-Release number of selected component (if applicable):
qemu-kvm-0.12.1.2-2.198.el6.x86_64.rpm
Verified on qemu-kvm-0.12.1.2-2.248.el6.x86_64:
1. edit /etc/ksmtuned.conf
# uncomment the following if you want ksmtuned debug info
LOGFILE=/var/log/ksmtuned
DEBUG=1
2. #service ksmtuned restart
3. check "committed memory" at /var/log/ksmtuned
Test suggest that, on a 8G host, boot guest of 4G, ksm is activated until the 8th guest boot up.
However, i find a little flaw:
Thu Mar 15 23:37:44 CST 2012: total 7379492
Thu Mar 15 23:37:44 CST 2012: sleep 22
Thu Mar 15 23:37:44 CST 2012: thres 1475898
...
Thu Mar 15 23:47:45 CST 2012: 7005790 > 7379492, start ksm
Thu Mar 15 23:47:45 CST 2012: 1467916 < 1475898, boost
Thu Mar 15 23:47:45 CST 2012: KSMCTL start 300 22
here "7005790 > 7379492", ksm is activated when:
[ $[committed + thres] -lt $total -a $free -gt $thres ] is false
But after use rsz instead of vsz, free < thres will always happen before committed + thres > total, for there are other processes taking memory, this won't affect ksm functioning, just log confuses people, worth fixing?
(In reply to comment #12)
> Since qemu-kvm 262 removes kvm-ksmtuned-should-use-rsz-instead-of-vsz.patch
> from rpm spec file, move this back to assigned.
The patch is for the SPEC file and it has been applied manually so moving back to ON_QA. Nothing changed but the patch file is no longer here because it's not necessary to have it here.
Michal
Technical note added. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.
New Contents:
Cause:
Incorrect value has been used to start ksmtuned.
Consequence:
KSM (Kernel Samepage Merging) turned on too early.
Fix:
Use real memory size instead of virtual memory size for calculating qemu-kvm memory usage.
Result:
Turning on KSM is more optimized
Technical note updated. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.
Diffed Contents:
@@ -1,5 +1,5 @@
Cause:
-Incorrect value has been used to start ksmtuned.
+Incorrect value has been used to calculate qemu-kvm memory usage (and turn on KSM).
Consequence:
KSM (Kernel Samepage Merging) turned on too early.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
http://rhn.redhat.com/errata/RHBA-2012-0746.html
Description of problem: In ksmtuned there's this line: ps -C "$progname" -o vsz= | awk '{ sum += $1 }; END { print sum }' "vsz" in not a good way to estimate the mem usage, this line makes KSM turn on way too early. Version-Release number of selected component (if applicable): qemu-kvm-0.12.1.2-2.198.el6.x86_64.rpm