From: Ni zhan Chen <nizhan.chen@gmail.com>
To: Izik Eidus <izik.eidus@ravellosystems.com>
Cc: Linux Memory Management List <linux-mm@kvack.org>,
Andrea Arcangeli <aarcange@redhat.com>,
Petr Holasek <pholasek@redhat.com>,
Hugh Dickins <hughd@google.com>,
Chris Wright <chrisw@sous-sol.org>,
Rik van Riel <riel@redhat.com>
Subject: Re: ksm questions
Date: Wed, 24 Oct 2012 20:35:38 +0800 [thread overview]
Message-ID: <5087E09A.3080101@gmail.com> (raw)
In-Reply-To: <5087D50D.8000101@ravellosystems.com>
[-- Attachment #1: Type: text/plain, Size: 2321 bytes --]
On 10/24/2012 07:46 PM, Izik Eidus wrote:
> On 10/24/2012 01:19 PM, Ni zhan Chen wrote:
>> Hi all,
>>
>> I have some questions about ksm.
>>
>> 1) khugepaged default nice value is 19, but ksmd default nice value
>> is 5, why this big different?
>> 2) why ksm doesn't support pagecache and tmpfs now? What's the
>> bottleneck?
>> 3) ksm kernel doc said that "KSM only merges anonymous(private)
>> pages, never pagecache(file) pages". But where judege it should be
>> private?
>> 4) ksm kernel doc said that "To avoid the instability and the
>> resulting false negatives to be permanent, KSM re-initializes the
>> unstable tree root node to an empty tree, at every KSM pass." But I
>> can't find where re-initializes the unstable tree, could you explain me?
>
>
> in scan_get_next_rmap_item(), if (slot == &ksm_mm_head) then we do
> root_unstable_tree = RB_ROOT; this will result in root_unstable_tree
> being empty.
Hi Izik,
Another four questions, thank for your patience and excellent codes. :-)
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_item,
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,
????????????????????
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
>
>>
>> Thanks in advance. :-)
>>
>> Regards,
>> Chen
>>
>
>
[-- Attachment #2: Type: text/html, Size: 4193 bytes --]
next prev parent reply other threads:[~2012-10-24 12:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-24 11:19 Ni zhan Chen
2012-10-24 11:46 ` Izik Eidus
2012-10-24 11:59 ` Ni zhan Chen
2012-10-24 12:02 ` Izik Eidus
2012-10-24 12:16 ` Ni zhan Chen
2012-10-24 12:20 ` Izik Eidus
2012-10-24 12:35 ` Ni zhan Chen [this message]
2012-10-24 12:40 ` 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=5087E09A.3080101@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