mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nikita Danilov <nikita@clusterfs.com>
To: "liyu@LAN" <liyu@ccoss.com.cn>
Cc: linux-kernel@vger.kernel.org
Subject: Re: one question about LRU mechanism
Date: Wed, 15 Jun 2005 15:29:15 +0400	[thread overview]
Message-ID: <17072.4363.161693.887061@gargle.gargle.HOWL> (raw)
In-Reply-To: <1118817991.5828.23.camel@liyu.ccoss.com.cn>

liyu@LAN writes:

[...]

 > 
 > /************************************************************/
 >         while (scan++ < nr_to_scan && !list_empty(src)) {
 >                 page = lru_to_page(src);
 >                 prefetchw_prev_lru_page(page, src, flags);
 >                                                                                                     
 >                 if (!TestClearPageLRU(page))
 >                         BUG();
 >                 list_del(&page->lru);

[...]

 > 
 > /***************************************************/
 >         while (scan++ < nr_to_scan && !list_empty(src->prev)) {

list_empty(something) and list_empty(something->prev) are equivalent for
well-formed lists.

list_empty(src) check in isolate_lru_pages() is for pathological case
when active list becomes empty. Also active and inactive lists are not
LRU, they are closer to second-chance-FIFO, it is _together_ that they
emulate LRU.

Nikita.

      parent reply	other threads:[~2005-06-15 11:29 UTC|newest]

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

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=17072.4363.161693.887061@gargle.gargle.HOWL \
    --to=nikita@clusterfs.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liyu@ccoss.com.cn \
    /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®