All of lore.kernel.org
 help / color / mirror / Atom feed
* KSM & hugepages
@ 2010-03-23 11:32 Michael Tokarev
  2010-03-23 13:07 ` Avi Kivity
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Tokarev @ 2010-03-23 11:32 UTC (permalink / raw)
  To: Kernel Mailing List, kvm-devel

Hello.

I noticed an interesting thing here, with qemu-kvm, KSM and
hugepages.

When I initially enabled KSM, for my two windows guests I've
seen ~100 000 pages in /sys/kernel/mm/ksm/pages_shared .
That's quite good, and overall memory usage improved.

Now, I also enabled hugepages in kvm, which speed things
up quite significantly (the speedup is noticeable).

But now, when both KSM and hugepages are activated, I don't
see KSM in action anymore.  /sys/../mm/pages_shared shows
56 pages, which is nothing.

So I wonder what's up:
 o that's 56 _huge_ pages (which means the actual saving
   is 56*2M = 112Mb, which isn't really bad).  If that's
   the case, /sys/../mm/ interface lacks proper units
   reporting;
 o due to large pages there's much less chance to find
   two pages with identical contents, so very little can
   be shared;
 o KSM does not scan hugepages at all
 o something else.

What is the issue here?

Thanks!

/mjt

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: KSM & hugepages
  2010-03-23 11:32 KSM & hugepages Michael Tokarev
@ 2010-03-23 13:07 ` Avi Kivity
  0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2010-03-23 13:07 UTC (permalink / raw)
  To: Michael Tokarev; +Cc: Kernel Mailing List, kvm-devel

On 03/23/2010 01:32 PM, Michael Tokarev wrote:
> Hello.
>
> I noticed an interesting thing here, with qemu-kvm, KSM and
> hugepages.
>
> When I initially enabled KSM, for my two windows guests I've
> seen ~100 000 pages in /sys/kernel/mm/ksm/pages_shared .
> That's quite good, and overall memory usage improved.
>
> Now, I also enabled hugepages in kvm, which speed things
> up quite significantly (the speedup is noticeable).
>
> But now, when both KSM and hugepages are activated, I don't
> see KSM in action anymore.  /sys/../mm/pages_shared shows
> 56 pages, which is nothing.
>
> So I wonder what's up:
>   o that's 56 _huge_ pages (which means the actual saving
>     is 56*2M = 112Mb, which isn't really bad).  If that's
>     the case, /sys/../mm/ interface lacks proper units
>     reporting;
>   o due to large pages there's much less chance to find
>     two pages with identical contents, so very little can
>     be shared;
>   o KSM does not scan hugepages at all
>   o something else.
>
> What is the issue here?
>
>    

Those pages aren't scanned since ksm only scans anonymous memory; 
hugetlbfs is file backed memory.   Even if it were anonymous memory, ksm 
doesn't support merging large pages (and the probability of finding a 
match is practically nil).  No idea where the 56 comes from - perhaps a 
leak from the previous runs?

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-03-23 13:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-23 11:32 KSM & hugepages Michael Tokarev
2010-03-23 13:07 ` Avi Kivity

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.