linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Re: Better active/inactive list balancing
       [not found] <517B6DF5.70402@gmail.com>
@ 2013-04-27  6:20 ` Mtrr Patt
  2013-04-30 16:32   ` Johannes Weiner
  0 siblings, 1 reply; 5+ messages in thread
From: Mtrr Patt @ 2013-04-27  6:20 UTC (permalink / raw)
  To: Johannes Weiner
  Cc: Rik van Riel, Dave Hansen, Michal Hocko, Mel Gorman, linux-mm

[-- Attachment #1: Type: text/plain, Size: 581 bytes --]

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


[-- Attachment #2: Type: text/html, Size: 1262 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Better active/inactive list balancing
  2013-04-27  6:20 ` Better active/inactive list balancing Mtrr Patt
@ 2013-04-30 16:32   ` Johannes Weiner
  2013-05-01  6:55     ` Mtrr Patt
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Weiner @ 2013-04-30 16:32 UTC (permalink / raw)
  To: Mtrr Patt; +Cc: Rik van Riel, Dave Hansen, Michal Hocko, Mel Gorman, linux-mm

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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Better active/inactive list balancing
  2013-04-30 16:32   ` Johannes Weiner
@ 2013-05-01  6:55     ` Mtrr Patt
  2013-05-01 15:21       ` Johannes Weiner
  0 siblings, 1 reply; 5+ messages in thread
From: Mtrr Patt @ 2013-05-01  6:55 UTC (permalink / raw)
  To: Johannes Weiner
  Cc: Rik van Riel, Dave Hansen, Michal Hocko, Mel Gorman, linux-mm

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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Better active/inactive list balancing
  2013-05-01  6:55     ` Mtrr Patt
@ 2013-05-01 15:21       ` Johannes Weiner
  2013-05-01 23:35         ` Mtrr Patt
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Weiner @ 2013-05-01 15:21 UTC (permalink / raw)
  To: Mtrr Patt; +Cc: Rik van Riel, Dave Hansen, Michal Hocko, Mel Gorman, linux-mm

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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Better active/inactive list balancing
  2013-05-01 15:21       ` Johannes Weiner
@ 2013-05-01 23:35         ` Mtrr Patt
  0 siblings, 0 replies; 5+ messages in thread
From: Mtrr Patt @ 2013-05-01 23:35 UTC (permalink / raw)
  To: Johannes Weiner
  Cc: Rik van Riel, Dave Hansen, Michal Hocko, Mel Gorman, linux-mm

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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-05-01 23:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <517B6DF5.70402@gmail.com>
2013-04-27  6:20 ` Better active/inactive list balancing Mtrr Patt
2013-04-30 16:32   ` Johannes Weiner
2013-05-01  6:55     ` Mtrr Patt
2013-05-01 15:21       ` Johannes Weiner
2013-05-01 23:35         ` Mtrr Patt

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