public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* locked page handling
@ 2001-12-31 10:20 alad
  2001-12-31 19:37 ` Andrew Morton
  0 siblings, 1 reply; 6+ messages in thread
From: alad @ 2001-12-31 10:20 UTC (permalink / raw)
  To: linux-kernel



In 2.4.16, vmscan.c::shrink_cache(), we have following piece of code -

          /*
           * The page is locked. IO in progress?
           * Move it to the back of the list.
           */
          if (unlikely(TryLockPage(page))) {
               if (PageLaunder(page) && (gfp_mask & __GFP_FS)) {
                    page_cache_get(page);
                    spin_unlock(&pagemap_lru_lock);
                    wait_on_page(page);
                    page_cache_release(page);
                    spin_lock(&pagemap_lru_lock);
               }
               continue;
          }

1) Who is moving the page the back of list ?
2) Is the locked page worth waiting for? I can understand that the page is being
 laundered so after wait we may get a clean page but from performance
     point of view this is involving unnecessary context switches. Also during
high memory pressure kswapd shall sleep here when it can get more
     clean pages on the inactive list ? What are we loosing if we don't wait on
the page and believe that in next pass we shall free this page

-- Amol






^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: locked page handling
@ 2002-01-02  4:58 alad
  0 siblings, 0 replies; 6+ messages in thread
From: alad @ 2002-01-02  4:58 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel








Andrew Morton <akpm@zip.com.au> on 01/01/2002 01:19:05 AM

To:   Amol Lad/HSS@HSS, linux-kernel@vger.kernel.org
cc:

Subject:  Re: locked page handling




Andrew Morton wrote:
>
> alad@hss.hns.com wrote:
> >
> > ...
> > 1) Who is moving the page the back of list ?
>
> Nobody.  The comment is wrong.
>

Sorry. The page has *already* at the back of the list. It's the very
first thing that happens:

                list_del(entry);
                list_add(entry, &inactive_list);

So the comment should read "Leave it at the back of the inactive list".

>>>>> well....list_add() moves the page to the beginning of list......

-





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

end of thread, other threads:[~2002-01-02  5:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-12-31 10:20 locked page handling alad
2001-12-31 19:37 ` Andrew Morton
2001-12-31 19:49   ` Andrew Morton
2001-12-31 19:58   ` Daniel Phillips
2001-12-31 20:23     ` Andrew Morton
  -- strict thread matches above, loose matches on Subject: below --
2002-01-02  4:58 alad

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