Skip to contentSkip to conversation

Better active/inactive list balancing

DISCUSSION Mtrr Patt 2 participants 5 messages Apr 27, 2013 – May 1, 2013 1 message not in the archive Memory management

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Mtrr Patt

author
#1 lore raw

cc linux-mm

Quoted 10 lines · Mtrr Patt

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?

#2 lore raw
Quoted 16 lines · Mtrr Patt

cc linux-mm

Quoted 13 lines · Mtrr Patt

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 [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

author
#3 lore raw

Hi Johannes,

Quoted 15 lines · Johannes Weiner
Quoted 14 lines · Mtrr Patt

cc linux-mm

Quoted 11 lines · Mtrr Patt

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

Quoted 6 lines
Quoted 2 lines
Quoted 2 lines

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?

Quoted 2 lines

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 [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#4 lore raw

Hi Wanpeng Li / Ni zhan Chen / Jaegeuk Hanse / Simon Jeons / Will Huck / Ric Mason / Sam Ben / Mtrr Patt!

Quoted 19 lines · Mtrr Patt

Hi Johannes,

Quoted 17 lines · Johannes Weiner
Quoted 16 lines · Mtrr Patt

cc linux-mm

Quoted 13 lines · Mtrr Patt

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?

Quoted 7 lines
Quoted 4 lines

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.

Quoted 5 lines
Quoted 2 lines

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 [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

author
#5 lore raw

Hi Johannes,

Quoted 34 lines · Johannes Weiner

Hi Wanpeng Li / Ni zhan Chen / Jaegeuk Hanse / Simon Jeons / Will Huck / Ric Mason / Sam Ben / Mtrr Patt!

Quoted 17 lines · Mtrr Patt

Hi Johannes,

Quoted 15 lines · Johannes Weiner
Quoted 14 lines · Mtrr Patt

cc linux-mm

Quoted 11 lines · Mtrr Patt

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

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Quoted 2 lines

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.

Quoted 2 lines
Quoted 2 lines

When mapped pages reach the end of the inactive list and have that bit set, they get activated, see page_check_references().

Quoted 8 lines
Quoted 2 lines

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 [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>