linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ni zhan Chen <nizhan.chen@gmail.com>
To: Linux Memory Management List <linux-mm@kvack.org>
Cc: Izik Eidus <izik.eidus@ravellosystems.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Petr Holasek <pholasek@redhat.com>,
	Chris Wright <chrisw@sous-sol.org>,
	Rik van Riel <riel@redhat.com>, Hugh Dickins <hughd@google.com>
Subject: some ksm questions
Date: Thu, 25 Oct 2012 09:55:35 +0800	[thread overview]
Message-ID: <50889C17.4090607@gmail.com> (raw)

Hi all,

I have some detail questions about ksm. Thanks in adance. :-)

1) Why judge if(page->mapping != expected_mapping) in function get_ksm_page
called twice? And it also call put_page(page) in the second time, when this
put_page associated get_page(page) is called?

2)
in function scan_get_next_rmap_itemi 1/4 ?
if (PageAnon(*page)) ||
page_trans_compound_anon(*page)) {
flush_anon_page(vma, *page, ksm_scan.address);
flush_dcache_page(*page);
rmap_item = get_next_rmap_item(slot,
a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??
why call flush_dcache_page here? in kernel doc 
Documentation/cachetlb.txt, it
said that "Any time the kernel writes to a page cache page, _OR_ the 
kernel is
about to read from a page cache page and user space shared/writable 
mappings of
this page potentially exist, this routine is called", it is used for 
flush page
cache related cpu cache, but ksmd only scan anonymous page.

3) in function remove_rmap_item_from_tree, how to understand formula age =
(unsigned char) (ksm_scan.seqr - rmap_item->address); why need aging?

4) in function page_volatile_show, how to understand ksm_pages_volatile =
ksm_rmap_items - ksm_pages_shared - ksm_pages_sharing - 
ksm_pages_unshared; I
mean that how this formula can figure out "how many pages changing too 
fast to
be placed in a tree"?

Regards,
Chen

--
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>

             reply	other threads:[~2012-10-25  1:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-25  1:55 Ni zhan Chen [this message]
2012-10-25  2:00 Ni zhan Chen

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=50889C17.4090607@gmail.com \
    --to=nizhan.chen@gmail.com \
    --cc=aarcange@redhat.com \
    --cc=chrisw@sous-sol.org \
    --cc=hughd@google.com \
    --cc=izik.eidus@ravellosystems.com \
    --cc=linux-mm@kvack.org \
    --cc=pholasek@redhat.com \
    --cc=riel@redhat.com \
    /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