I'm running Rawhide with a qemu-kvm VM that runs WinXP.
I'm noticing 'ksmd' running at a constant 15-25% of my cpu, for example:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 32 root 25 5 0 0 0 S 21.2 0.0 2:06.75 ksmd 2265 tbl 20 0 1227m 530m 8256 R 17.2 13.5 3:09.05 qemu-kvm 1599 root 20 0 220m 42m 17m S 5.3 1.1 0:55.02 Xorg 2203 tbl 20 0 1234m 62m 24m S 5.0 1.6 0:28.93 rhythmbox
Checking, I see that "ksmd" is running, but "ksmtuned" is not.
System is Thinkpad X200 with 4GB RAM. VM image is configured at 512MB.
Is this "to be expected" behavior?
tom
Hi Tom,
On Tue, 2009-10-27 at 08:58 -0700, Tom London wrote:
I'm running Rawhide with a qemu-kvm VM that runs WinXP.
I'm noticing 'ksmd' running at a constant 15-25% of my cpu, for example:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 32 root 25 5 0 0 0 S 21.2 0.0 2:06.75 ksmd 2265 tbl 20 0 1227m 530m 8256 R 17.2 13.5 3:09.05 qemu-kvm 1599 root 20 0 220m 42m 17m S 5.3 1.1 0:55.02 Xorg 2203 tbl 20 0 1234m 62m 24m S 5.0 1.6 0:28.93 rhythmbox
Checking, I see that "ksmd" is running, but "ksmtuned" is not.
System is Thinkpad X200 with 4GB RAM. VM image is configured at 512MB.
Is this "to be expected" behavior?
We're just discussing something similar on the fedora-virt list
Currently, ksm is enabled by default in the kernel - since it's disabled by default in 2.6.32, we'll probably switch to that behaviour
Do you have the ksm or ksmtuned init scripts enabled? Does enabling ksmtuned help reduce the CPU usage?
Cheers, Mark.
On Tue, Oct 27, 2009 at 8:59 AM, Mark McLoughlin markmc@redhat.com wrote:
Hi Tom,
On Tue, 2009-10-27 at 08:58 -0700, Tom London wrote:
I'm running Rawhide with a qemu-kvm VM that runs WinXP.
I'm noticing 'ksmd' running at a constant 15-25% of my cpu, for example:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 32 root 25 5 0 0 0 S 21.2 0.0 2:06.75 ksmd 2265 tbl 20 0 1227m 530m 8256 R 17.2 13.5 3:09.05 qemu-kvm 1599 root 20 0 220m 42m 17m S 5.3 1.1 0:55.02 Xorg 2203 tbl 20 0 1234m 62m 24m S 5.0 1.6 0:28.93 rhythmbox
Checking, I see that "ksmd" is running, but "ksmtuned" is not.
System is Thinkpad X200 with 4GB RAM. VM image is configured at 512MB.
Is this "to be expected" behavior?
We're just discussing something similar on the fedora-virt list
Currently, ksm is enabled by default in the kernel - since it's disabled by default in 2.6.32, we'll probably switch to that behaviour
Do you have the ksm or ksmtuned init scripts enabled? Does enabling ksmtuned help reduce the CPU usage?
Cheers, Mark.
Appears that Rawhide has "ksmd" enabled by default. "ksmtuned" is not enabled by default.
Starting ksmtuned via [root@tlondon init.d]# service ksmtuned start Starting ksmtuned: [ OK ] [root@tlondon init.d]#
Had no immediate effect (in fact, appeared to increase CPU up to about 28-30%) for about a minute or 2.
But after that, top no longer reports ksmd:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 2265 tbl 20 0 1227m 530m 8256 S 17.2 13.5 6:04.56 qemu-kvm 2298 tbl 20 0 849m 161m 27m S 13.2 4.1 1:18.68 firefox 1599 root 20 0 219m 44m 17m S 9.3 1.1 1:28.51 Xorg 2203 tbl 20 0 1235m 64m 24m S 4.0 1.6 0:53.86 rhythmbox 1903 tbl 9 -11 541m 29m 28m S 3.0 0.8 0:23.55 pulseaudio
But I notice that "ksm" appears off:
[root@tlondon init.d]# service ksm status ksm is not running [root@tlondon init.d]# service ksmtuned status ksmtuned (pid 2559) is running... [root@tlondon init.d]#
Interesting tuning.... ;)
Any idea what is going on?
tom
On Tue, 2009-10-27 at 09:08 -0700, Tom London wrote: ...
But I notice that "ksm" appears off:
[root@tlondon init.d]# service ksm status ksm is not running [root@tlondon init.d]# service ksmtuned status ksmtuned (pid 2559) is running... [root@tlondon init.d]#
Interesting tuning.... ;)
Any idea what is going on?
Yes, because ksmd (a kernel thread) is enabled by default, the ksm init script isn't needed to enable it currently
However, in 2.6.32, ksmd is disabled by default and the ksm init script will be needed to enable it
Cheers, Mark.
On Tue, Oct 27, 2009 at 9:10 AM, Mark McLoughlin markmc@redhat.com wrote:
On Tue, 2009-10-27 at 09:08 -0700, Tom London wrote: ...
But I notice that "ksm" appears off:
[root@tlondon init.d]# service ksm status ksm is not running [root@tlondon init.d]# service ksmtuned status ksmtuned (pid 2559) is running... [root@tlondon init.d]#
Interesting tuning.... ;)
Any idea what is going on?
Yes, because ksmd (a kernel thread) is enabled by default, the ksm init script isn't needed to enable it currently
However, in 2.6.32, ksmd is disabled by default and the ksm init script will be needed to enable it
Cheers, Mark.
OK. So is the "reasonable" setup to have "ksmtuned" enabled (to disable "ksm")?
Or is it necessary to manually run "service ksmtuned start" manually.....
tom
On Tue, Oct 27, 2009 at 09:20:20AM -0700, Tom London wrote:
On Tue, Oct 27, 2009 at 9:10 AM, Mark McLoughlin markmc@redhat.com wrote:
On Tue, 2009-10-27 at 09:08 -0700, Tom London wrote: ...
But I notice that "ksm" appears off:
[root@tlondon init.d]# service ksm status ksm is not running [root@tlondon init.d]# service ksmtuned status ksmtuned (pid 2559) is running... [root@tlondon init.d]#
Interesting tuning.... ;)
Any idea what is going on?
Yes, because ksmd (a kernel thread) is enabled by default, the ksm init script isn't needed to enable it currently
However, in 2.6.32, ksmd is disabled by default and the ksm init script will be needed to enable it
Cheers, Mark.
OK. So is the "reasonable" setup to have "ksmtuned" enabled (to disable "ksm")?
Or is it necessary to manually run "service ksmtuned start" manually.....
ksmtuned is not really there to disable ksm, it will enable and disable based on what the system is doing... It checks every so often and resets ksm if it sees a need. Ideally you would have both ksm and ksmtuned on. The ksm service will enable ksm if it is disabled, but more importantly it sets the number of pages ksm can use to half of memory instead of the horribly low 2k default. The ksm service would start, set the limits and turn on ksm if it were off. The ksmtuned would then start and check the system, make sure ksm has done the work it needs to based on what the system is running and then turn off ksm. Chances are when ksmtuned makes its first pass, there is no mergeable memory so it just shuts off ksm. Once you start a few vms, ksmtuned will notice this on the next wakeup and enable ksm long enough to scan and do its job.
Justin
On Tue, Oct 27, 2009 at 11:48 AM, Justin M. Forbes jmforbes@linuxtx.org wrote:
On Tue, Oct 27, 2009 at 09:20:20AM -0700, Tom London wrote:
On Tue, Oct 27, 2009 at 9:10 AM, Mark McLoughlin markmc@redhat.com wrote:
On Tue, 2009-10-27 at 09:08 -0700, Tom London wrote: ...
But I notice that "ksm" appears off:
[root@tlondon init.d]# service ksm status ksm is not running [root@tlondon init.d]# service ksmtuned status ksmtuned (pid 2559) is running... [root@tlondon init.d]#
Interesting tuning.... ;)
Any idea what is going on?
Yes, because ksmd (a kernel thread) is enabled by default, the ksm init script isn't needed to enable it currently
However, in 2.6.32, ksmd is disabled by default and the ksm init script will be needed to enable it
Cheers, Mark.
OK. So is the "reasonable" setup to have "ksmtuned" enabled (to disable "ksm")?
Or is it necessary to manually run "service ksmtuned start" manually.....
ksmtuned is not really there to disable ksm, it will enable and disable based on what the system is doing... It checks every so often and resets ksm if it sees a need. Ideally you would have both ksm and ksmtuned on. The ksm service will enable ksm if it is disabled, but more importantly it sets the number of pages ksm can use to half of memory instead of the horribly low 2k default. The ksm service would start, set the limits and turn on ksm if it were off. The ksmtuned would then start and check the system, make sure ksm has done the work it needs to based on what the system is running and then turn off ksm. Chances are when ksmtuned makes its first pass, there is no mergeable memory so it just shuts off ksm. Once you start a few vms, ksmtuned will notice this on the next wakeup and enable ksm long enough to scan and do its job.
Justin
Thanks.
I'll set both ksm and ksmtuned to "enabled" and see what happens on the next boot.
tom