From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx194.postini.com [74.125.245.194]) by kanga.kvack.org (Postfix) with SMTP id 121116B0032 for ; Sat, 27 Apr 2013 02:21:00 -0400 (EDT) Received: by mail-oa0-f67.google.com with SMTP id o17so1103983oag.10 for ; Fri, 26 Apr 2013 23:21:00 -0700 (PDT) Message-ID: <517B6E46.30209@gmail.com> Date: Sat, 27 Apr 2013 14:20:54 +0800 From: Mtrr Patt MIME-Version: 1.0 Subject: Re: Better active/inactive list balancing References: <517B6DF5.70402@gmail.com> In-Reply-To: <517B6DF5.70402@gmail.com> Content-Type: multipart/alternative; boundary="------------070705000208000807020303" Sender: owner-linux-mm@kvack.org List-ID: To: Johannes Weiner Cc: Rik van Riel , Dave Hansen , Michal Hocko , Mel Gorman , linux-mm@kvack.org This is a multi-part message in MIME format. --------------070705000208000807020303 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc linux-mm On 04/27/2013 02:19 PM, Mtrr Patt wrote: > Hi Johannes, > > http://lwn.net/Articles/495543/ > > This link said that "When active pages are considered for eviction, > they are first moved to the inactive list and unmapped from the > address space of the process(es) using them. Thus, once a page moves > to the inactive list, any attempt to reference it will generate a page > fault; this "soft fault" will cause the page to be removed back to the > active list." > > Why I can't find the codes unmap during page moved from active list to > inactive list? > > > --------------070705000208000807020303 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
cc linux-mm

On 04/27/2013 02:19 PM, Mtrr Patt wrote:
Hi Johannes,

http://lwn.net/Articles/495543/

This link said that "When active pages are considered for eviction, they are first moved to the inactive list and unmapped from the address space of the process(es) using them. Thus, once a page moves to the inactive list, any attempt to reference it will generate a page fault; this "soft fault" will cause the page to be removed back to the active list."

Why I can't find the codes unmap during page moved from active list to inactive list?
 



--------------070705000208000807020303-- -- 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 (na3sys010amx105.postini.com [74.125.245.105]) by kanga.kvack.org (Postfix) with SMTP id 9C3F46B011B for ; Tue, 30 Apr 2013 12:32:43 -0400 (EDT) Date: Tue, 30 Apr 2013 12:32:30 -0400 From: Johannes Weiner Subject: Re: Better active/inactive list balancing Message-ID: <20130430163230.GB1229@cmpxchg.org> References: <517B6DF5.70402@gmail.com> <517B6E46.30209@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <517B6E46.30209@gmail.com> Sender: owner-linux-mm@kvack.org List-ID: To: Mtrr Patt Cc: Rik van Riel , Dave Hansen , Michal Hocko , Mel Gorman , linux-mm@kvack.org On Sat, Apr 27, 2013 at 02:20:54PM +0800, Mtrr Patt wrote: > cc linux-mm > > On 04/27/2013 02:19 PM, Mtrr Patt wrote: > >Hi Johannes, > > > >http://lwn.net/Articles/495543/ > > > >This link said that "When active pages are considered for > >eviction, they are first moved to the inactive list and unmapped > >from the address space of the process(es) using them. Thus, once a > >page moves to the inactive list, any attempt to reference it will > >generate a page fault; this "soft fault" will cause the page to be > >removed back to the active list." > > > >Why I can't find the codes unmap during page moved from active > >list to inactive list? Most architectures have the hardware track the referenced bit in the page tables, but some don't. For them, page_referenced_one() will mark the mapping read-only when clearing the referenced/young bit and the page fault handler will set the bit manually. When mapped pages reach the end of the inactive list and have that bit set, they get activated, see page_check_references(). -- 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 (na3sys010amx172.postini.com [74.125.245.172]) by kanga.kvack.org (Postfix) with SMTP id AD5F36B015B for ; Wed, 1 May 2013 02:56:02 -0400 (EDT) Received: by mail-yh0-f41.google.com with SMTP id i57so246286yha.28 for ; Tue, 30 Apr 2013 23:56:01 -0700 (PDT) Message-ID: <5180BC79.8080101@gmail.com> Date: Wed, 01 May 2013 14:55:53 +0800 From: Mtrr Patt MIME-Version: 1.0 Subject: Re: Better active/inactive list balancing References: <517B6DF5.70402@gmail.com> <517B6E46.30209@gmail.com> <20130430163230.GB1229@cmpxchg.org> In-Reply-To: <20130430163230.GB1229@cmpxchg.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Johannes Weiner Cc: Rik van Riel , Dave Hansen , Michal Hocko , Mel Gorman , linux-mm@kvack.org Hi Johannes, On 05/01/2013 12:32 AM, Johannes Weiner wrote: > On Sat, Apr 27, 2013 at 02:20:54PM +0800, Mtrr Patt wrote: >> cc linux-mm >> >> On 04/27/2013 02:19 PM, Mtrr Patt wrote: >>> Hi Johannes, >>> >>> http://lwn.net/Articles/495543/ >>> >>> This link said that "When active pages are considered for >>> eviction, they are first moved to the inactive list and unmapped >> >from the address space of the process(es) using them. Thus, once a >>> page moves to the inactive list, any attempt to reference it will >>> generate a page fault; this "soft fault" will cause the page to be >>> removed back to the active list." >>> >>> Why I can't find the codes unmap during page moved from active >>> list to inactive list? > Most architectures have the hardware track the referenced bit in the > page tables, but some don't. For them, page_referenced_one() will > mark the mapping read-only when clearing the referenced/young bit and > the page fault handler will set the bit manually. Thanks for your response. ;-) So the article is not against more common case, isn't it? > When mapped pages reach the end of the inactive list and have that bit > set, they get activated, see page_check_references(). It seems that the page should trigger page fault twice and page_check_references can active it. -- 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 (na3sys010amx190.postini.com [74.125.245.190]) by kanga.kvack.org (Postfix) with SMTP id C8F176B0189 for ; Wed, 1 May 2013 11:21:18 -0400 (EDT) Date: Wed, 1 May 2013 11:21:05 -0400 From: Johannes Weiner Subject: Re: Better active/inactive list balancing Message-ID: <20130501152105.GB8083@cmpxchg.org> References: <517B6DF5.70402@gmail.com> <517B6E46.30209@gmail.com> <20130430163230.GB1229@cmpxchg.org> <5180BC79.8080101@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5180BC79.8080101@gmail.com> Sender: owner-linux-mm@kvack.org List-ID: To: Mtrr Patt Cc: Rik van Riel , Dave Hansen , Michal Hocko , Mel Gorman , linux-mm@kvack.org Hi Wanpeng Li / Ni zhan Chen / Jaegeuk Hanse / Simon Jeons / Will Huck / Ric Mason / Sam Ben / Mtrr Patt! On Wed, May 01, 2013 at 02:55:53PM +0800, Mtrr Patt wrote: > Hi Johannes, > On 05/01/2013 12:32 AM, Johannes Weiner wrote: > >On Sat, Apr 27, 2013 at 02:20:54PM +0800, Mtrr Patt wrote: > >>cc linux-mm > >> > >>On 04/27/2013 02:19 PM, Mtrr Patt wrote: > >>>Hi Johannes, > >>> > >>>http://lwn.net/Articles/495543/ > >>> > >>>This link said that "When active pages are considered for > >>>eviction, they are first moved to the inactive list and unmapped > >>>from the address space of the process(es) using them. Thus, once a > >>>page moves to the inactive list, any attempt to reference it will > >>>generate a page fault; this "soft fault" will cause the page to be > >>>removed back to the active list." > >>> > >>>Why I can't find the codes unmap during page moved from active > >>>list to inactive list? > >Most architectures have the hardware track the referenced bit in the > >page tables, but some don't. For them, page_referenced_one() will > >mark the mapping read-only when clearing the referenced/young bit and > >the page fault handler will set the bit manually. > > Thanks for your response. ;-) So the article is not against more > common case, isn't it? It's about the generic/theoretic case I guess, not the optimized implementation. > >When mapped pages reach the end of the inactive list and have that bit > >set, they get activated, see page_check_references(). > > It seems that the page should trigger page fault twice and > page_check_references can active it. The first one brings it into memory (major fault), the second one sets the referenced bit (minor fault or set by mmu). Then it gets activated. That is the case for mmap accessed pages. Buffered IO (read/write syscalls) enters the kernel anyway, so we activate the pages right then and there with mark_page_accessed(). -- 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 (na3sys010amx180.postini.com [74.125.245.180]) by kanga.kvack.org (Postfix) with SMTP id 94A116B0249 for ; Wed, 1 May 2013 19:36:07 -0400 (EDT) Received: by mail-ve0-f176.google.com with SMTP id b10so25796vea.7 for ; Wed, 01 May 2013 16:36:06 -0700 (PDT) Message-ID: <5181A6DE.7000400@gmail.com> Date: Thu, 02 May 2013 07:35:58 +0800 From: Mtrr Patt MIME-Version: 1.0 Subject: Re: Better active/inactive list balancing References: <517B6DF5.70402@gmail.com> <517B6E46.30209@gmail.com> <20130430163230.GB1229@cmpxchg.org> <5180BC79.8080101@gmail.com> <20130501152105.GB8083@cmpxchg.org> In-Reply-To: <20130501152105.GB8083@cmpxchg.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Johannes Weiner Cc: Rik van Riel , Dave Hansen , Michal Hocko , Mel Gorman , linux-mm@kvack.org Hi Johannes, On 05/01/2013 11:21 PM, Johannes Weiner wrote: > Hi Wanpeng Li / Ni zhan Chen / Jaegeuk Hanse / Simon Jeons / Will Huck > / Ric Mason / Sam Ben / Mtrr Patt! > > On Wed, May 01, 2013 at 02:55:53PM +0800, Mtrr Patt wrote: >> Hi Johannes, >> On 05/01/2013 12:32 AM, Johannes Weiner wrote: >>> On Sat, Apr 27, 2013 at 02:20:54PM +0800, Mtrr Patt wrote: >>>> cc linux-mm >>>> >>>> On 04/27/2013 02:19 PM, Mtrr Patt wrote: >>>>> Hi Johannes, >>>>> >>>>> http://lwn.net/Articles/495543/ >>>>> >>>>> This link said that "When active pages are considered for >>>>> eviction, they are first moved to the inactive list and unmapped >>>> >from the address space of the process(es) using them. Thus, once a >>>>> page moves to the inactive list, any attempt to reference it will >>>>> generate a page fault; this "soft fault" will cause the page to be >>>>> removed back to the active list." >>>>> >>>>> Why I can't find the codes unmap during page moved from active >>>>> list to inactive list? >>> Most architectures have the hardware track the referenced bit in the >>> page tables, but some don't. For them, page_referenced_one() will >>> mark the mapping read-only when clearing the referenced/young bit and >>> the page fault handler will set the bit manually. >> Thanks for your response. ;-) So the article is not against more >> common case, isn't it? > It's about the generic/theoretic case I guess, not the optimized > implementation. > >>> When mapped pages reach the end of the inactive list and have that bit >>> set, they get activated, see page_check_references(). >> It seems that the page should trigger page fault twice and >> page_check_references can active it. > The first one brings it into memory (major fault), the second one sets > the referenced bit (minor fault or set by mmu). Then it gets > activated. That is the case for mmap accessed pages. > > Buffered IO (read/write syscalls) enters the kernel anyway, so we > activate the pages right then and there with mark_page_accessed(). Thanks for your explaination. Why you say hi to other guys, confuse me! ;-) -- 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