From: caiqian@redhat.com
To: Hugh Dickins <hughd@google.com>
Cc: linux-mm <linux-mm@kvack.org>
Subject: Re: understand KSM
Date: Wed, 27 Oct 2010 04:16:38 -0400 (EDT) [thread overview]
Message-ID: <1014156042.534481288167398779.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com> (raw)
In-Reply-To: <395413139.534301288167215758.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com>
> Since your 1MB malloc'ed buffers may not fall on page boundaries,
> and there might occasionally be other malloc'ed areas interspersed
> amongst them, I'm not surprised that pages_sharing falls a little
> short of 98302. But I am surprised that pages_unshared does not
> make up the difference; probably pages_volatile does, but I don't
> see why some should remain volatile indefinitely.
The test program (http://people.redhat.com/qcai/ksm01.c) was changed to use mmap instead of malloc, and pages_sharing was short of the expected value and pages_volatile was indeed non-zero. Those makes it is difficult to predict pages_sharing and pages_volatile although it might be fine to check pages_sharing + pages_volatile with an expected value. Any suggestion to alter the test code to check the stable numbers? Thanks.
ksm01 0 TINFO : child 0 allocates 128 MB filled with 'c'.
ksm01 0 TINFO : child 1 allocates 128 MB filled with 'a'.
ksm01 0 TINFO : child 2 allocates 128 MB filled with 'a'.
ksm01 0 TINFO : pages_shared is 2.
ksm01 0 TINFO : pages_sharing is 98300.
ksm01 0 TINFO : pages_unshared is 0.
ksm01 0 TINFO : pages_volatile is 2.
ksm01 0 TINFO : child 1 changes memory content to 'b'.
ksm01 0 TINFO : pages_shared is 3.
ksm01 0 TINFO : pages_sharing is 98291.
ksm01 0 TINFO : pages_unshared is 0.
ksm01 0 TINFO : pages_volatile is 10.
ksm01 0 TINFO : child 0 changes memory content to 'd'.
ksm01 0 TINFO : child 1 changes memory content to 'd'
ksm01 0 TINFO : child 2 changes memory content to 'd'
ksm01 0 TINFO : pages_shared is 1.
ksm01 0 TINFO : pages_sharing is 98299.
ksm01 0 TINFO : pages_unshared is 0.
ksm01 0 TINFO : pages_volatile is 4.
ksm01 0 TINFO : child 1 changes one page to 'e'.
ksm01 0 TINFO : pages_shared is 1.
ksm01 0 TINFO : pages_sharing is 98299.
ksm01 0 TINFO : pages_unshared is 1.
ksm01 0 TINFO : pages_volatile is 3.
CAI Qian
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next parent reply other threads:[~2010-10-27 8:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <395413139.534301288167215758.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com>
2010-10-27 8:16 ` caiqian [this message]
2010-11-09 6:48 ` understand KSM Hugh Dickins
2010-11-10 9:25 ` CAI Qian
[not found] <356409918.247361287997619777.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com>
2010-10-25 9:11 ` caiqian
2010-10-26 8:03 ` Hugh Dickins
2010-10-26 11:14 ` CAI Qian
2010-10-27 4:00 ` Hugh Dickins
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1014156042.534481288167398779.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com \
--to=caiqian@redhat.com \
--cc=hughd@google.com \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).