mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "liyu@WAN" <liyu@ccoss.com.cn>
To: linux-kernel@vger.kernel.org
Subject: one question about LRU mechanism
Date: Wed, 15 Jun 2005 13:12:56 +0800	[thread overview]
Message-ID: <1118812376.32766.4.camel@liyu.ccoss.com.cn> (raw)

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


             reply	other threads:[~2005-06-15  5:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-15  5:12 liyu@WAN [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1118812376.32766.4.camel@liyu.ccoss.com.cn \
    --to=liyu@ccoss.com.cn \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®