[fedora-virt] disabling ksm by default

Mark McLoughlin markmc at redhat.com
Tue Oct 27 10:12:49 UTC 2009

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:


Suggestions, comments, patches etc. welcome


More information about the Fedora-virt mailing list