linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Andrew Morton <akpm@osdl.org>
Cc: Nikita Danilov <nikita@clusterfs.com>, linux-mm@kvack.org
Subject: Re: [PATCH]: VM 8/8 shrink_list(): set PG_reclaimed
Date: Tue, 26 Apr 2005 15:48:19 +1000	[thread overview]
Message-ID: <1114494499.25240.19.camel@npiggin-nld.site> (raw)
In-Reply-To: <1114493245.25240.4.camel@npiggin-nld.site>

On Tue, 2005-04-26 at 15:27 +1000, Nick Piggin wrote:
> On Mon, 2005-04-25 at 21:29 -0700, Andrew Morton wrote:
> > Nikita Danilov <nikita@clusterfs.com> wrote:
> > >
> > > 
> > > set PG_reclaimed bit on pages that are under writeback when shrink_list()
> > > looks at them: these pages are at end of the inactive list, and it only makes
> > > sense to reclaim them as soon as possible when writeout finishes.
> > > 
> > 
> > Makes sense, I guess.  It would be nice to know how many pages actually get
> > this treatment, and under what situations.
> > 
> > To address the race which Nick identified I think we can do it this way?
> > 
> 
> I did the same patch a while back and I had a feeling this didn't work
> either. I can't immediately see a race...


Somewhere, a light-bulb flickers...

shrink_list():                | end_page_writeback():
------------------------------|---------------------------------------                              
if (PageWriteback(page)) {    |
  if (!PageReclaim(page)) {   |
                              | if (!TestClearPageReclaim(page)) {
    SetPageReclaim(page);     |
    if (!PageWriteback(page)) |
      ClearPageReclaim(page); |
                              |   if (!test_clear_page_writeback(page))
                              |     BUG();

          |
          |
          V
PageReclaim && !PageWriteback == BUG


And yes, IIRC I actually did hit this race when testing - probably this
*exact* code (granted it took a while :P)

-- 
SUSE Labs, Novell Inc.


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

  reply	other threads:[~2005-04-26  5:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-17 17:38 Nikita Danilov
2005-04-18  1:13 ` Nick Piggin
2005-04-18 16:18   ` Nikita Danilov
2005-04-26  4:29 ` Andrew Morton
2005-04-26  5:27   ` Nick Piggin
2005-04-26  5:48     ` Nick Piggin [this message]
2005-04-26 10:16   ` Nikita Danilov
2005-04-26 10:29     ` Andrew Morton
2005-04-26 10:32     ` Nick Piggin

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=1114494499.25240.19.camel@npiggin-nld.site \
    --to=nickpiggin@yahoo.com.au \
    --cc=akpm@osdl.org \
    --cc=linux-mm@kvack.org \
    --cc=nikita@clusterfs.com \
    /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