Hi, I saw that Fedora 12 will have ksm tunning script that control the ksm speed / kernel pages allocation.
The only problem that I have is - as far as I remember ksm is by default enabled and only with 2000 kernel pages... What I am worried about is that users wont use the ksm tunning script and would just run ksm with this 2000 kernel pages - the result would be that ksm will probably merge just the zero pages (that could be alot of memory) and the user might not know that much more memory can be saved...
Is it possible to at least make ksm disabled by default? so the users will have to run the ksm tunning script when they want to start ksm?
And if we set it to disabled by default, cant we set the initialized values into more realistic value? (like 1/4 of the memory in the mainline kernels? )
Thanks.
Hi Izik,
On Tue, 2009-10-27 at 00:55 +0200, Izik Eidus wrote:
Hi, I saw that Fedora 12 will have ksm tunning script that control the ksm speed / kernel pages allocation.
The only problem that I have is - as far as I remember ksm is by default enabled and only with 2000 kernel pages... What I am worried about is that users wont use the ksm tunning script and would just run ksm with this 2000 kernel pages - the result would be that ksm will probably merge just the zero pages (that could be alot of memory) and the user might not know that much more memory can be saved...
Is it possible to at least make ksm disabled by default? so the users will have to run the ksm tunning script when they want to start ksm?
ksm is disabled by default currently
And if we set it to disabled by default, cant we set the initialized values into more realistic value? (like 1/4 of the memory in the mainline kernels? )
Here's the logic we have in the init script:
# unless KSM_MAX_KERNEL_PAGES is set, let ksm munch up to half of total memory. default_max_kernel_pages () { local total pagesize total=`awk '/^MemTotal:/ {print $2}' /proc/meminfo` pagesize=`getconf PAGESIZE` echo $[total * 1024 / pagesize / 2] }
git tree for the scripts here:
http://gitorious.org/ksm-control-scripts/ksm-control-scripts
Suggestions, comments, patches etc. welcome
Thanks, Mark.
On 10/27/2009 12:12 PM, Mark McLoughlin wrote:
Hi Izik,
On Tue, 2009-10-27 at 00:55 +0200, Izik Eidus wrote:
Hi, I saw that Fedora 12 will have ksm tunning script that control the ksm speed / kernel pages allocation.
The only problem that I have is - as far as I remember ksm is by default enabled and only with 2000 kernel pages... What I am worried about is that users wont use the ksm tunning script and would just run ksm with this 2000 kernel pages - the result would be that ksm will probably merge just the zero pages (that could be alot of memory) and the user might not know that much more memory can be saved...
Is it possible to at least make ksm disabled by default? so the users will have to run the ksm tunning script when they want to start ksm?
ksm is disabled by default currently
Ok so we are fine then.
And if we set it to disabled by default, cant we set the initialized values into more realistic value? (like 1/4 of the memory in the mainline kernels? )
Here's the logic we have in the init script:
# unless KSM_MAX_KERNEL_PAGES is set, let ksm munch up to half of total memory. default_max_kernel_pages () { local total pagesize total=`awk '/^MemTotal:/ {print $2}' /proc/meminfo` pagesize=`getconf PAGESIZE` echo $[total * 1024 / pagesize / 2] }
git tree for the scripts here:
http://gitorious.org/ksm-control-scripts/ksm-control-scripts
Suggestions, comments, patches etc. welcome
Thanks.
On Tue, Oct 27, 2009 at 12:24:13PM +0200, Izik Eidus wrote:
On 10/27/2009 12:12 PM, Mark McLoughlin wrote:
Hi Izik,
On Tue, 2009-10-27 at 00:55 +0200, Izik Eidus wrote:
Hi, I saw that Fedora 12 will have ksm tunning script that control the ksm speed / kernel pages allocation.
The only problem that I have is - as far as I remember ksm is by default enabled and only with 2000 kernel pages... What I am worried about is that users wont use the ksm tunning script and would just run ksm with this 2000 kernel pages - the result would be that ksm will probably merge just the zero pages (that could be alot of memory) and the user might not know that much more memory can be saved...
Is it possible to at least make ksm disabled by default? so the users will have to run the ksm tunning script when they want to start ksm?
ksm is disabled by default currently
Ok so we are fine then.
Actually, Izik is refering to the fact that ksm is, by default, running when the kernel boots.
He'd like to see something like
diff -u -r1.1 linux-2.6-ksm-updates.patch --- linux-2.6-ksm-updates.patch 7 Aug 2009 19:07:39 -0000 1.1 +++ linux-2.6-ksm-updates.patch 27 Oct 2009 12:34:57 -0000 @@ -1661,7 +1661,7 @@ #define KSM_RUN_MERGE 1 #define KSM_RUN_UNMERGE 2 -static unsigned int ksm_run; -+static unsigned int ksm_run = KSM_RUN_MERGE; ++static unsigned int ksm_run = KSM_RUN_STOP;
static DECLARE_WAIT_QUEUE_HEAD(ksm_thread_wait); static DEFINE_MUTEX(ksm_thread_mutex);
to behave more like upstream 2.6.32
http://osdir.com/ml/linux-kernel/2009-09/msg09309.html http://osdir.com/ml/linux-kernel/2009-09/msg09777.html
On Tue, Oct 27, 2009 at 02:37:50PM +0200, Dan Kenigsberg wrote:
On Tue, Oct 27, 2009 at 12:24:13PM +0200, Izik Eidus wrote:
On 10/27/2009 12:12 PM, Mark McLoughlin wrote:
Hi Izik,
On Tue, 2009-10-27 at 00:55 +0200, Izik Eidus wrote:
Hi, I saw that Fedora 12 will have ksm tunning script that control the ksm speed / kernel pages allocation.
There are actually 2 init scripts. One to turn on ksm, and one for tuning. The actual ksm init script simply makes sure ksm is turned on in the kernel and sets max_kernel_pages to half of system memory. The ksmtuned script is a bit more involved.
The only problem that I have is - as far as I remember ksm is by default enabled and only with 2000 kernel pages... What I am worried about is that users wont use the ksm tunning script and would just run ksm with this 2000 kernel pages - the result would be that ksm will probably merge just the zero pages (that could be alot of memory) and the user might not know that much more memory can be saved...
Is it possible to at least make ksm disabled by default? so the users will have to run the ksm tunning script when they want to start ksm?
Actually, Izik is refering to the fact that ksm is, by default, running when the kernel boots.
While I do understand what you are saying, I don't think it is worth making a kernel change for at this point in the cycle. Because ksm itself has a separate initscript, people who wish to use ksm will likely turn it on. This sets the max_kernel_pages to a reasonable value. People who are not interested enough to turn on the ksm service are probably not the kind of people who will be checking to see how effective ksm is at all.
Justin
On 10/27/2009 04:42 PM, Justin M. Forbes wrote:
On Tue, Oct 27, 2009 at 02:37:50PM +0200, Dan Kenigsberg wrote:
On Tue, Oct 27, 2009 at 12:24:13PM +0200, Izik Eidus wrote:
On 10/27/2009 12:12 PM, Mark McLoughlin wrote:
Hi Izik,
On Tue, 2009-10-27 at 00:55 +0200, Izik Eidus wrote:
Hi, I saw that Fedora 12 will have ksm tunning script that control the ksm speed / kernel pages allocation.
There are actually 2 init scripts. One to turn on ksm, and one for tuning. The actual ksm init script simply makes sure ksm is turned on in the kernel and sets max_kernel_pages to half of system memory. The ksmtuned script is a bit more involved.
The only problem that I have is - as far as I remember ksm is by default enabled and only with 2000 kernel pages... What I am worried about is that users wont use the ksm tunning script and would just run ksm with this 2000 kernel pages - the result would be that ksm will probably merge just the zero pages (that could be alot of memory) and the user might not know that much more memory can be saved...
Is it possible to at least make ksm disabled by default? so the users will have to run the ksm tunning script when they want to start ksm?
Actually, Izik is refering to the fact that ksm is, by default, running when the kernel boots.
While I do understand what you are saying, I don't think it is worth making a kernel change for at this point in the cycle. Because ksm itself has a separate initscript, people who wish to use ksm will likely turn it on. This sets the max_kernel_pages to a reasonable value. People who are not interested enough to turn on the ksm service are probably not the kind of people who will be checking to see how effective ksm is at all.
Justin
from http://forum.zwame.pt/showthread.php?p=5449039:
"I tested KSM out by creating a couple of Ubuntu 9.04 VMs with 1GB of RAM apiece and a Windows 7 VM with 2GB of RAM. Together, these VMs laid claim to the bulk of the 4GB of RAM available on my test Fedora 12 system.
When I switched KSM on, I watched the memory usage on my test machine fall, fairly quickly, from 3.1GB to 2.1GB as my system identified and merged duplicate memory pages. I want to see KSM in action on a more realistically outfitted system, but I'm impressed the capability as I've seen it so far.
Beyond KSM, I'm pleased to see that in Fedora 12, KVM will support hotplugging for virtual network adapters, and will present guest machines with an emulated hardware platform that remains consistent across upgrades of the hypervisor. Linux OSes tend not to care when hardware is changed underneath them, but this can cause problems with Windows. I've experienced broken Windows VM installs following KVM upgrades, and I welcome this improvement."
To me it sound that users have no idea about this script, and ksm merge to him just the zero pages of windows 7...
My feeling is that 99% of the ppl in the world that will use it, would just see the zero page merged and think "that is it..." The current behaivor in fedora 12 is misleading the user (at least it seems to me that it misslead that specific user)
Btw we can set this value from userspace if we want "echo 0 > /sys/kernel/mm/ksm/run"
On Tue, 2009-10-27 at 17:31 +0200, Izik Eidus wrote:
On 10/27/2009 04:42 PM, Justin M. Forbes wrote:
While I do understand what you are saying, I don't think it is worth making a kernel change for at this point in the cycle. Because ksm itself has a separate initscript, people who wish to use ksm will likely turn it on. This sets the max_kernel_pages to a reasonable value. People who are not interested enough to turn on the ksm service are probably not the kind of people who will be checking to see how effective ksm is at all.
To me it sound that users have no idea about this script, and ksm merge to him just the zero pages of windows 7...
My feeling is that 99% of the ppl in the world that will use it, would just see the zero page merged and think "that is it..." The current behaivor in fedora 12 is misleading the user (at least it seems to me that it misslead that specific user)
Btw we can set this value from userspace if we want "echo 0 > /sys/kernel/mm/ksm/run"
Where would we put that in userspace? Another init script? I just updated to documentation on the feature page (and hopefully in the final release notes) to say that ksm can be enabled by running 'sudo chkconfig ksm on' in effort to draw more attention to these scripts.
The other option is to make the ksm init script default to on, and just leave ksmtuned off at system start. Since ksm is on by the default kernel, all we would be doing here is changing max_kernel_pages to a machine specific value. The ksm init script is part of the qemu package, so it would only be changed on systems doing virt anyway.
Justin
On Tue, 2009-10-27 at 10:46 -0500, Justin M. Forbes wrote:
On Tue, 2009-10-27 at 17:31 +0200, Izik Eidus wrote:
On 10/27/2009 04:42 PM, Justin M. Forbes wrote:
While I do understand what you are saying, I don't think it is worth making a kernel change for at this point in the cycle. Because ksm itself has a separate initscript, people who wish to use ksm will likely turn it on. This sets the max_kernel_pages to a reasonable value. People who are not interested enough to turn on the ksm service are probably not the kind of people who will be checking to see how effective ksm is at all.
To me it sound that users have no idea about this script, and ksm merge to him just the zero pages of windows 7...
My feeling is that 99% of the ppl in the world that will use it, would just see the zero page merged and think "that is it..." The current behaivor in fedora 12 is misleading the user (at least it seems to me that it misslead that specific user)
Btw we can set this value from userspace if we want "echo 0 > /sys/kernel/mm/ksm/run"
Where would we put that in userspace? Another init script? I just updated to documentation on the feature page (and hopefully in the final release notes) to say that ksm can be enabled by running 'sudo chkconfig ksm on' in effort to draw more attention to these scripts.
The other option is to make the ksm init script default to on, and just leave ksmtuned off at system start. Since ksm is on by the default kernel, all we would be doing here is changing max_kernel_pages to a machine specific value. The ksm init script is part of the qemu package, so it would only be changed on systems doing virt anyway.
For Fedora 13, it'll be off by default in the kernel and the recommended way of switching it on is with 'chkconfig ksm on'
For Fedora 12, it's on by default in the kernel, 'chkconfig ksm on' just changes max pages and the only way of disabling it is by manually writing zero to /sys/kernel/mm/ksm/run
IMHO, if we are to change anything for Fedora 12, we should move closer to Fedora 13 behaviour, not further away from it - i.e. make it off by default in the kernel, but I'm fine with delaying that until post GA
We'll probably end up with this behaviour in F12 updates at some point anyway when 2.6.32 is pulled in
Cheers, Mark.
On Tue, Oct 27, 2009 at 03:55:16PM +0000, Mark McLoughlin wrote:
On Tue, 2009-10-27 at 10:46 -0500, Justin M. Forbes wrote:
On Tue, 2009-10-27 at 17:31 +0200, Izik Eidus wrote:
On 10/27/2009 04:42 PM, Justin M. Forbes wrote:
For Fedora 13, it'll be off by default in the kernel and the recommended way of switching it on is with 'chkconfig ksm on'
For Fedora 12, it's on by default in the kernel, 'chkconfig ksm on' just changes max pages and the only way of disabling it is by manually writing zero to /sys/kernel/mm/ksm/run
IMHO, if we are to change anything for Fedora 12, we should move closer to Fedora 13 behaviour, not further away from it - i.e. make it off by default in the kernel, but I'm fine with delaying that until post GA
We'll probably end up with this behaviour in F12 updates at some point anyway when 2.6.32 is pulled in
Agreed, we should change our custom patches to match upstream, so its off by default.
Daniel
On Tue, 2009-10-27 at 16:05 +0000, Daniel P. Berrange wrote:
On Tue, Oct 27, 2009 at 03:55:16PM +0000, Mark McLoughlin wrote:
On Tue, 2009-10-27 at 10:46 -0500, Justin M. Forbes wrote:
On Tue, 2009-10-27 at 17:31 +0200, Izik Eidus wrote:
On 10/27/2009 04:42 PM, Justin M. Forbes wrote:
For Fedora 13, it'll be off by default in the kernel and the recommended way of switching it on is with 'chkconfig ksm on'
For Fedora 12, it's on by default in the kernel, 'chkconfig ksm on' just changes max pages and the only way of disabling it is by manually writing zero to /sys/kernel/mm/ksm/run
IMHO, if we are to change anything for Fedora 12, we should move closer to Fedora 13 behaviour, not further away from it - i.e. make it off by default in the kernel, but I'm fine with delaying that until post GA
We'll probably end up with this behaviour in F12 updates at some point anyway when 2.6.32 is pulled in
Agreed, we should change our custom patches to match upstream, so its off by default.
We have done this twice now, initially ksm defaulted to off, and to merge with what was to become 2.6.32 we ended up with the default on and the current page limits. Of course upstream has changed again. Behavior doesn't change with the init script. People really don't know how to check if ksm is on or off without checking the documentation. As long as our documentation points to the initscript instead of modifying sysfs we get the desired behavior.
Justin
On Tue, 2009-10-27 at 15:55 +0000, Mark McLoughlin wrote:
On Tue, 2009-10-27 at 10:46 -0500, Justin M. Forbes wrote:
On Tue, 2009-10-27 at 17:31 +0200, Izik Eidus wrote:
On 10/27/2009 04:42 PM, Justin M. Forbes wrote:
While I do understand what you are saying, I don't think it is worth making a kernel change for at this point in the cycle. Because ksm itself has a separate initscript, people who wish to use ksm will likely turn it on. This sets the max_kernel_pages to a reasonable value. People who are not interested enough to turn on the ksm service are probably not the kind of people who will be checking to see how effective ksm is at all.
To me it sound that users have no idea about this script, and ksm merge to him just the zero pages of windows 7...
My feeling is that 99% of the ppl in the world that will use it, would just see the zero page merged and think "that is it..." The current behaivor in fedora 12 is misleading the user (at least it seems to me that it misslead that specific user)
Btw we can set this value from userspace if we want "echo 0 > /sys/kernel/mm/ksm/run"
Where would we put that in userspace? Another init script? I just updated to documentation on the feature page (and hopefully in the final release notes) to say that ksm can be enabled by running 'sudo chkconfig ksm on' in effort to draw more attention to these scripts.
The other option is to make the ksm init script default to on, and just leave ksmtuned off at system start. Since ksm is on by the default kernel, all we would be doing here is changing max_kernel_pages to a machine specific value. The ksm init script is part of the qemu package, so it would only be changed on systems doing virt anyway.
For Fedora 13, it'll be off by default in the kernel and the recommended way of switching it on is with 'chkconfig ksm on'
For Fedora 12, it's on by default in the kernel, 'chkconfig ksm on' just changes max pages and the only way of disabling it is by manually writing zero to /sys/kernel/mm/ksm/run
IMHO, if we are to change anything for Fedora 12, we should move closer to Fedora 13 behaviour, not further away from it - i.e. make it off by default in the kernel, but I'm fine with delaying that until post GA
We'll probably end up with this behaviour in F12 updates at some point anyway when 2.6.32 is pulled in
This is exactly why I am more concerned with people using the init script than changing something else. If people use the init script, behavior doesn't change when F12 updates to 2.6.32. Whether or not we default the ksm init script to on might be a conversation worth having, but making other changes just seems a bit hackish at this point.
Justin
On 10/27/2009 05:55 PM, Mark McLoughlin wrote:
On Tue, 2009-10-27 at 10:46 -0500, Justin M. Forbes wrote:
On Tue, 2009-10-27 at 17:31 +0200, Izik Eidus wrote:
On 10/27/2009 04:42 PM, Justin M. Forbes wrote:
While I do understand what you are saying, I don't think it is worth making a kernel change for at this point in the cycle. Because ksm itself has a separate initscript, people who wish to use ksm will likely turn it on. This sets the max_kernel_pages to a reasonable value. People who are not interested enough to turn on the ksm service are probably not the kind of people who will be checking to see how effective ksm is at all.
To me it sound that users have no idea about this script, and ksm merge to him just the zero pages of windows 7...
My feeling is that 99% of the ppl in the world that will use it, would just see the zero page merged and think "that is it..." The current behaivor in fedora 12 is misleading the user (at least it seems to me that it misslead that specific user)
Btw we can set this value from userspace if we want "echo 0> /sys/kernel/mm/ksm/run"
Where would we put that in userspace? Another init script? I just updated to documentation on the feature page (and hopefully in the final release notes) to say that ksm can be enabled by running 'sudo chkconfig ksm on' in effort to draw more attention to these scripts.
The other option is to make the ksm init script default to on, and just leave ksmtuned off at system start. Since ksm is on by the default kernel, all we would be doing here is changing max_kernel_pages to a machine specific value. The ksm init script is part of the qemu package, so it would only be changed on systems doing virt anyway.
For Fedora 13, it'll be off by default in the kernel and the recommended way of switching it on is with 'chkconfig ksm on'
For Fedora 12, it's on by default in the kernel, 'chkconfig ksm on' just changes max pages and the only way of disabling it is by manually writing zero to /sys/kernel/mm/ksm/run
IMHO, if we are to change anything for Fedora 12, we should move closer to Fedora 13 behaviour, not further away from it - i.e. make it off by default in the kernel, but I'm fine with delaying that until post GA
So what the result of this thread? you are delaying it to post GA?
We'll probably end up with this behaviour in F12 updates at some point anyway when 2.6.32 is pulled in
Cheers, Mark.
On Fri, Oct 30, 2009 at 09:22:05PM +0200, Izik Eidus wrote:
On 10/27/2009 05:55 PM, Mark McLoughlin wrote:
On Tue, 2009-10-27 at 10:46 -0500, Justin M. Forbes wrote:
On Tue, 2009-10-27 at 17:31 +0200, Izik Eidus wrote:
On 10/27/2009 04:42 PM, Justin M. Forbes wrote:
While I do understand what you are saying, I don't think it is worth making a kernel change for at this point in the cycle. Because ksm itself has a separate initscript, people who wish to use ksm will likely turn it on. This sets the max_kernel_pages to a reasonable value. People who are not interested enough to turn on the ksm service are probably not the kind of people who will be checking to see how effective ksm is at all.
To me it sound that users have no idea about this script, and ksm merge to him just the zero pages of windows 7...
My feeling is that 99% of the ppl in the world that will use it, would just see the zero page merged and think "that is it..." The current behaivor in fedora 12 is misleading the user (at least it seems to me that it misslead that specific user)
Btw we can set this value from userspace if we want "echo 0> /sys/kernel/mm/ksm/run"
Where would we put that in userspace? Another init script? I just updated to documentation on the feature page (and hopefully in the final release notes) to say that ksm can be enabled by running 'sudo chkconfig ksm on' in effort to draw more attention to these scripts.
The other option is to make the ksm init script default to on, and just leave ksmtuned off at system start. Since ksm is on by the default kernel, all we would be doing here is changing max_kernel_pages to a machine specific value. The ksm init script is part of the qemu package, so it would only be changed on systems doing virt anyway.
For Fedora 13, it'll be off by default in the kernel and the recommended way of switching it on is with 'chkconfig ksm on'
For Fedora 12, it's on by default in the kernel, 'chkconfig ksm on' just changes max pages and the only way of disabling it is by manually writing zero to /sys/kernel/mm/ksm/run
IMHO, if we are to change anything for Fedora 12, we should move closer to Fedora 13 behaviour, not further away from it - i.e. make it off by default in the kernel, but I'm fine with delaying that until post GA
So what the result of this thread? you are delaying it to post GA?
kernel is kept with ksm_run = KSM_RUN_MERGE by deafult (different from upstream, God forbid!), but init.d/ksm runs by default and sets max_kernel_pages to a reasonable value.
http://gitorious.org/ksm-control-scripts/ksm-control-scripts/commit/0a242288...
On 10/27/2009 05:46 PM, Justin M. Forbes wrote:
On Tue, 2009-10-27 at 17:31 +0200, Izik Eidus wrote:
On 10/27/2009 04:42 PM, Justin M. Forbes wrote:
While I do understand what you are saying, I don't think it is worth making a kernel change for at this point in the cycle. Because ksm itself has a separate initscript, people who wish to use ksm will likely turn it on. This sets the max_kernel_pages to a reasonable value. People who are not interested enough to turn on the ksm service are probably not the kind of people who will be checking to see how effective ksm is at all.
To me it sound that users have no idea about this script, and ksm merge to him just the zero pages of windows 7...
My feeling is that 99% of the ppl in the world that will use it, would just see the zero page merged and think "that is it..." The current behaivor in fedora 12 is misleading the user (at least it seems to me that it misslead that specific user)
Btw we can set this value from userspace if we want "echo 0> /sys/kernel/mm/ksm/run"
Where would we put that in userspace? Another init script? I just updated to documentation on the feature page (and hopefully in the final release notes) to say that ksm can be enabled by running 'sudo chkconfig ksm on' in effort to draw more attention to these scripts.
The other option is to make the ksm init script default to on, and just leave ksmtuned off at system start. Since ksm is on by the default kernel, all we would be doing here is changing max_kernel_pages to a machine specific value. The ksm init script is part of the qemu package, so it would only be changed on systems doing virt anyway.
Sound Great to me, Can we please do that?
(I am sorry I came at such late time, but I saw that ppl just run ./qemu and think ksm is working effective when they see the memory shrink (while it truely just merge the zero pages for them - due to the 2000 pages limit))
Thanks.
Justin
On Tue, Oct 27, 2009 at 10:12:49AM +0000, Mark McLoughlin wrote:
ksm is disabled by default currently
[...]
# unless KSM_MAX_KERNEL_PAGES is set, let ksm munch up to half of total memory.
Mark, can you summarise why we wouldn't want KSM to be enabled by default, and why we need to limit it to half of total memory?
Assume the reader knows nothing about KSM, which is approximately correct :-)
Rich.
On Fri, Oct 30, 2009 at 10:00:28AM +0000, Richard W.M. Jones wrote:
On Tue, Oct 27, 2009 at 10:12:49AM +0000, Mark McLoughlin wrote:
ksm is disabled by default currently
[...]
# unless KSM_MAX_KERNEL_PAGES is set, let ksm munch up to half of total memory.
Mark, can you summarise why we wouldn't want KSM to be enabled by default, and why we need to limit it to half of total memory?
The limit to half of total memory is because ksm pages are unswappable at this time. To be fixed in a future kernel. As for enabling by default, the more I think about it, the more this makes sense. The ksm initscript is shipped with qemu, so anyone with it installed should be interested in virt, and the value of max_kernel_pages doesn't matter if you are not running anything which marks memory mergeable, which only kvm does at the moment.
Justin
On Fri, Oct 30, 2009 at 10:04:20AM -0500, Justin M. Forbes wrote:
On Fri, Oct 30, 2009 at 10:00:28AM +0000, Richard W.M. Jones wrote:
On Tue, Oct 27, 2009 at 10:12:49AM +0000, Mark McLoughlin wrote:
ksm is disabled by default currently
[...]
# unless KSM_MAX_KERNEL_PAGES is set, let ksm munch up to half of total memory.
Mark, can you summarise why we wouldn't want KSM to be enabled by default, and why we need to limit it to half of total memory?
The limit to half of total memory is because ksm pages are unswappable at this time. To be fixed in a future kernel. As for enabling by default, the more I think about it, the more this makes sense. The ksm initscript is shipped with qemu, so anyone with it installed should be interested in virt, and the value of max_kernel_pages doesn't matter if you are not running anything which marks memory mergeable, which only kvm does at the moment.
Having `chkconfig ksm on` by default is great. I just want to see that the kernel thread, which ksm service controls, is not running until the service has started. As you say, when there are no qemu processes, the kernel thread has very low cost. But it also has zero value. So why have it running?