public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* one question about LRU mechanism
@ 2005-06-15  5:12 liyu@WAN
  2005-06-15  5:25 ` William Lee Irwin III
  0 siblings, 1 reply; 6+ messages in thread
From: liyu@WAN @ 2005-06-15  5:12 UTC (permalink / raw)
  To: linux-kernel

Hello everybody:

	I am a linux kernel newbie. 

	I am reading memory managment code of kernel 2.6.11.11.
I found LRU is implement as linked-stack in linux, include two important
data structure linked-list :
zone->active_list and zone->inactive_list. when kernel need reclaim some
pages, it will call function refiil_inactive_list() ultimately to move
some page from active_list to inactive_list.

	It's OK, but I have one question in my mind:
I found all function that append page to active_list, it just append
page to head of active_list (use inline function list_add() ), but
refill_inactive_list() also start scanning from head of active_list, I
think the better way scan active_list is start from rear of active_list
and scan though prev member of list_head at reclaim pages. Scanning
start from head of active_list may make thrashing more possibly, I
think. and, in my view, "head of active_list" is zone->active_list,
"rear of active_list" is zone->active_list.prev .

	May be, I am failed understand mm? or what's wrong?

	Thanks in advanced.

	Alas, my english so bad.

						liyu


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

end of thread, other threads:[~2005-06-15 11:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-15  5:12 one question about LRU mechanism liyu@WAN
2005-06-15  5:25 ` William Lee Irwin III
2005-06-15  6:46   ` liyu@LAN
2005-06-15  7:29     ` William Lee Irwin III
2005-06-15  7:57     ` Paolo Ornati
2005-06-15 11:29     ` Nikita Danilov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox