mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrea Arcangeli <andrea@suse.de>
To: Chris Mason <mason@suse.com>
Cc: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
Subject: Re: writepages drops bh on not uptodate page
Date: Wed, 28 Jul 2004 15:46:40 +0200	[thread overview]
Message-ID: <20040728134640.GI15895@dualathlon.random> (raw)
In-Reply-To: <1091019818.6333.84.camel@watt.suse.com>

On Wed, Jul 28, 2004 at 09:03:39AM -0400, Chris Mason wrote:
> Ahhhh, this really explains it, thanks andrea.  I agree your fix should
> solve things, but I'm wondering if we shouldn't make readpage[s] do a
> wait_on_page_writeback().  That might do a better job of protecting us
> from future variations of this problem.

the invariant is that not-fully-uptodate pages needs the bh on them
while they're under writeback. As far as this holds true, there seems
not to be other issues since readpage checks the bh, and readpages don't
need to check for anything since it only does I/O on newly allocated
pages (which cannot be under writeback). try_to_free_buffers doesn't
allow the bh to go away under writeback.

So the other approach would be to wait_on_page_writeback before a
->readpage (not ->readpages), if we're not in a add_to_page_cache case
(where we know the page cannot be under writeback).  But that looks less
efficient and we don't need that as long as we don't break the above
invariant. Though I certainly agree that adding the
wait_on_page_writeback in the highlevel code that goes to call readpage
would have fixed the bug too.

      reply	other threads:[~2004-07-28 13:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-28  4:51 Andrea Arcangeli
2004-07-28  5:08 ` Andrew Morton
2004-07-28 13:03 ` Chris Mason
2004-07-28 13:46   ` Andrea Arcangeli [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=20040728134640.GI15895@dualathlon.random \
    --to=andrea@suse.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mason@suse.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

all inboxes | Powered by JetHome®