From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx182.postini.com [74.125.245.182]) by kanga.kvack.org (Postfix) with SMTP id 3A4E16B0070 for ; Wed, 24 Oct 2012 07:19:55 -0400 (EDT) Received: by mail-ob0-f169.google.com with SMTP id va7so413902obc.14 for ; Wed, 24 Oct 2012 04:19:54 -0700 (PDT) Message-ID: <5087CED1.2030307@gmail.com> Date: Wed, 24 Oct 2012 19:19:45 +0800 From: Ni zhan Chen MIME-Version: 1.0 Subject: ksm questions Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Linux Memory Management List Cc: Andrea Arcangeli , Petr Holasek , Hugh Dickins , Chris Wright , Rik van Riel , Izik Eidus 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? Thanks in advance. :-) 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx109.postini.com [74.125.245.109]) by kanga.kvack.org (Postfix) with SMTP id D9D206B0072 for ; Wed, 24 Oct 2012 07:46:27 -0400 (EDT) Received: by mail-ee0-f71.google.com with SMTP id c13so360987eek.2 for ; Wed, 24 Oct 2012 04:46:26 -0700 (PDT) Message-ID: <5087D50D.8000101@ravellosystems.com> Date: Wed, 24 Oct 2012 13:46:21 +0200 From: Izik Eidus MIME-Version: 1.0 Subject: Re: ksm questions References: <5087CED1.2030307@gmail.com> In-Reply-To: <5087CED1.2030307@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Ni zhan Chen Cc: Linux Memory Management List , Andrea Arcangeli , Petr Holasek , Hugh Dickins , Chris Wright , Rik van Riel 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. > > Thanks in advance. :-) > > 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx203.postini.com [74.125.245.203]) by kanga.kvack.org (Postfix) with SMTP id 1CA9D6B0070 for ; Wed, 24 Oct 2012 07:59:29 -0400 (EDT) Received: by mail-ob0-f169.google.com with SMTP id va7so453513obc.14 for ; Wed, 24 Oct 2012 04:59:28 -0700 (PDT) Message-ID: <5087D817.7070106@gmail.com> Date: Wed, 24 Oct 2012 19:59:19 +0800 From: Ni zhan Chen MIME-Version: 1.0 Subject: Re: ksm questions References: <5087CED1.2030307@gmail.com> <5087D50D.8000101@ravellosystems.com> In-Reply-To: <5087D50D.8000101@ravellosystems.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Izik Eidus Cc: Linux Memory Management List , Andrea Arcangeli , Petr Holasek , Hugh Dickins , Chris Wright , Rik van Riel 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. thanks Izik, what about the other three questions? > >> >> Thanks in advance. :-) >> >> 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx187.postini.com [74.125.245.187]) by kanga.kvack.org (Postfix) with SMTP id 51CB16B0070 for ; Wed, 24 Oct 2012 08:02:50 -0400 (EDT) Received: by mail-ee0-f71.google.com with SMTP id c13so374794eek.2 for ; Wed, 24 Oct 2012 05:02:48 -0700 (PDT) Message-ID: <5087D8E3.6090900@ravellosystems.com> Date: Wed, 24 Oct 2012 14:02:43 +0200 From: Izik Eidus MIME-Version: 1.0 Subject: Re: ksm questions References: <5087CED1.2030307@gmail.com> <5087D50D.8000101@ravellosystems.com> <5087D817.7070106@gmail.com> In-Reply-To: <5087D817.7070106@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Ni zhan Chen Cc: Linux Memory Management List , Andrea Arcangeli , Petr Holasek , Hugh Dickins , Chris Wright , Rik van Riel On 10/24/2012 01:59 PM, Ni zhan Chen wrote: > 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. > > thanks Izik, what about the other three questions? Question number 2 is beacuse it is forced to work with anonymous pages, about question 3 - I will have to remember why from the very begining I wrote it to support only anonymous pages (few years have been passed), maybe Andrea/Huge have it more hot in their heads? > >> >>> >>> Thanks in advance. :-) >>> >>> 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx145.postini.com [74.125.245.145]) by kanga.kvack.org (Postfix) with SMTP id 930B56B0070 for ; Wed, 24 Oct 2012 08:16:10 -0400 (EDT) Received: by mail-ie0-f169.google.com with SMTP id 10so704552ied.14 for ; Wed, 24 Oct 2012 05:16:09 -0700 (PDT) Message-ID: <5087DC00.6070408@gmail.com> Date: Wed, 24 Oct 2012 20:16:00 +0800 From: Ni zhan Chen MIME-Version: 1.0 Subject: Re: ksm questions References: <5087CED1.2030307@gmail.com> <5087D50D.8000101@ravellosystems.com> <5087D817.7070106@gmail.com> <5087D8E3.6090900@ravellosystems.com> In-Reply-To: <5087D8E3.6090900@ravellosystems.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Izik Eidus Cc: Linux Memory Management List , Andrea Arcangeli , Petr Holasek , Hugh Dickins , Chris Wright , Rik van Riel On 10/24/2012 08:02 PM, Izik Eidus wrote: > On 10/24/2012 01:59 PM, Ni zhan Chen wrote: >> 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. >> >> thanks Izik, what about the other three questions? > > Question number 2 is beacuse it is forced to work with anonymous > pages, about question 3 - I will have to remember why from the very > begining I wrote it to support only anonymous pages (few years have > been passed), maybe Andrea/Huge have it more hot in their heads? The initialize goal of design ksm is for virtualization, but now it also can be used for other apps. So can it also support tmpfs or pagecache in the future? > >> >>> >>>> >>>> Thanks in advance. :-) >>>> >>>> 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx136.postini.com [74.125.245.136]) by kanga.kvack.org (Postfix) with SMTP id A59BB6B0070 for ; Wed, 24 Oct 2012 08:20:15 -0400 (EDT) Received: by mail-wg0-f71.google.com with SMTP id es5so353521wgb.2 for ; Wed, 24 Oct 2012 05:20:14 -0700 (PDT) Message-ID: <5087DCF8.6080205@ravellosystems.com> Date: Wed, 24 Oct 2012 14:20:08 +0200 From: Izik Eidus MIME-Version: 1.0 Subject: Re: ksm questions References: <5087CED1.2030307@gmail.com> <5087D50D.8000101@ravellosystems.com> <5087D817.7070106@gmail.com> <5087D8E3.6090900@ravellosystems.com> <5087DC00.6070408@gmail.com> In-Reply-To: <5087DC00.6070408@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Ni zhan Chen Cc: Linux Memory Management List , Andrea Arcangeli , Petr Holasek , Hugh Dickins , Chris Wright , Rik van Riel On 10/24/2012 02:16 PM, Ni zhan Chen wrote: > On 10/24/2012 08:02 PM, Izik Eidus wrote: >> On 10/24/2012 01:59 PM, Ni zhan Chen wrote: >>> 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. >>> >>> thanks Izik, what about the other three questions? >> >> Question number 2 is beacuse it is forced to work with anonymous >> pages, about question 3 - I will have to remember why from the very >> begining I wrote it to support only anonymous pages (few years have >> been passed), maybe Andrea/Huge have it more hot in their heads? > > The initialize goal of design ksm is for virtualization, but now it > also can be used for other apps. So can it also support tmpfs or > pagecache in the future? Talking from far memory, I remember it was easier/cleaner to only support anonymous pages, until Andrea/Huge won`t remind us why I can`t answer this (Maybe later I will have some time to read a little bit the code again and to remember what is going on in linux VM...) > >> >>> >>>> >>>>> >>>>> Thanks in advance. :-) >>>>> >>>>> 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx159.postini.com [74.125.245.159]) by kanga.kvack.org (Postfix) with SMTP id 627BE6B0071 for ; Wed, 24 Oct 2012 08:35:50 -0400 (EDT) Received: by mail-oa0-f41.google.com with SMTP id k14so491826oag.14 for ; Wed, 24 Oct 2012 05:35:49 -0700 (PDT) Message-ID: <5087E09A.3080101@gmail.com> Date: Wed, 24 Oct 2012 20:35:38 +0800 From: Ni zhan Chen MIME-Version: 1.0 Subject: Re: ksm questions References: <5087CED1.2030307@gmail.com> <5087D50D.8000101@ravellosystems.com> In-Reply-To: <5087D50D.8000101@ravellosystems.com> Content-Type: multipart/alternative; boundary="------------040709060605010809040507" Sender: owner-linux-mm@kvack.org List-ID: To: Izik Eidus Cc: Linux Memory Management List , Andrea Arcangeli , Petr Holasek , Hugh Dickins , Chris Wright , Rik van Riel This is a multi-part message in MIME format. --------------040709060605010809040507 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 >> > > --------------040709060605010809040507 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
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




--------------040709060605010809040507-- -- 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx143.postini.com [74.125.245.143]) by kanga.kvack.org (Postfix) with SMTP id 9E1C06B0071 for ; Wed, 24 Oct 2012 08:40:35 -0400 (EDT) Received: by mail-ia0-f169.google.com with SMTP id h37so442936iak.14 for ; Wed, 24 Oct 2012 05:40:35 -0700 (PDT) Message-ID: <5087E1B6.9000002@gmail.com> Date: Wed, 24 Oct 2012 20:40:22 +0800 From: Ni zhan Chen MIME-Version: 1.0 Subject: Re: ksm questions References: <5087CED1.2030307@gmail.com> <5087D50D.8000101@ravellosystems.com> In-Reply-To: <5087D50D.8000101@ravellosystems.com> Content-Type: multipart/alternative; boundary="------------040906000804030607070003" Sender: owner-linux-mm@kvack.org List-ID: To: Izik Eidus Cc: Linux Memory Management List , Andrea Arcangeli , Petr Holasek , Hugh Dickins , Chris Wright , Rik van Riel This is a multi-part message in MIME format. --------------040906000804030607070003 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 >> > > --------------040906000804030607070003 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
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




--------------040906000804030607070003-- -- 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: email@kvack.org