From: Hugh Dickins <hughd@google.com>
To: Jeff Moyer <jmoyer@redhat.com>
Cc: "Richard W.M. Jones" <rjones@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Jens Axboe <jaxboe@fusionio.com>,
Torsten Hilbrich <torsten.hilbrich@secunet.com>,
Josh Boyer <jwboyer@redhat.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] block: replace __getblk_slow misfix by grow_dev_page fix
Date: Thu, 23 Aug 2012 15:46:19 -0700 (PDT) [thread overview]
Message-ID: <alpine.LSU.2.00.1208231527150.5852@eggly.anvils> (raw)
In-Reply-To: <x49obm1fil0.fsf@segfault.boston.devel.redhat.com>
On Thu, 23 Aug 2012, Jeff Moyer wrote:
> Hugh Dickins <hughd@google.com> writes:
>
> > [PATCH] block: replace __getblk_slow misfix by grow_dev_page fix
> >
> > Commit 91f68c89d8f3 ("block: fix infinite loop in __getblk_slow")
> > is not good: a successful call to grow_buffers() cannot guarantee
> > that the page won't be reclaimed before the immediate next call to
> > __find_get_block(), which is why there was always a loop there.
> [snip]
> > Revert 91f68c89d8f3, restoring __getblk_slow() to how it was (plus
> > a checkpatch nitfix). Simplify the interface between grow_buffers()
> > and grow_dev_page(), and avoid the infinite loop beyond end of device
> > by instead checking init_page_buffers()'s end_block there (I presume
> > that's more efficient than a repeated call to blkdev_max_block()),
> > returning -ENXIO to __getblk_slow() in that case.
> >
> > And remove akpm's ten-year-old "__getblk() cannot fail ... weird"
> > comment, but that is worrying: are all users of __getblk() really
> > now prepared for a NULL bh beyond end of device, or will some oops??
>
> Hi, Hugh,
>
> Thanks for digging into this. I had wondered whether that loop was
> required for other purposes, and you've verified that it was. I mostly
> like your fix. Returning end_block from init_page_buffers is a little
> strange,
It is a little strange, I agree. I wrestled a lot with the way block
and end_block were known at opposite ends of the callstack, and needed
to be brought together for the check.
If you think it would be better to move the blkdev_max_block()
lookup up a level into grow_dev_page(), then pass end_block down to
init_page_buffers(), that could work as well; though we'd then still
need to report "failure" from init_page_buffers().
I was inclined to leave it precisely where you had sited it, with that
comment on passing it back up; but could change it around if preferred.
> but I understand not wanting to redo the call to blkdev_max_block.
>
> I went ahead to re-tested with the reproducer that I had, and your patch
> works fine. Thanks again for tracking this down, and sorry I wasn't
> more diligent to begin with.
>
> Reviewed-and-Tested-by: Jeff Moyer <jmoyer@redhat.com>
Great, thanks a lot. It (but equally its incorrect earlier version)
have been running fine at home under my swapping load. I'm confident
that it fixes the issues I had been seeing, although, strictly speaking,
it'll take another two or three days to reach bisection confidence level.
Hugh
next prev parent reply other threads:[~2012-08-23 22:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-22 1:33 Hugh Dickins
2012-08-22 9:12 ` Richard W.M. Jones
2012-08-22 11:52 ` Richard W.M. Jones
2012-08-23 4:56 ` Hugh Dickins
2012-08-23 10:20 ` Jens Axboe
2012-08-23 20:40 ` Jeff Moyer
2012-08-23 22:46 ` Hugh Dickins [this message]
2012-08-24 13:13 ` Jeff Moyer
2012-08-28 11:14 ` Richard W.M. Jones
2012-08-28 14:35 ` Hugh Dickins
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=alpine.LSU.2.00.1208231527150.5852@eggly.anvils \
--to=hughd@google.com \
--cc=akpm@linux-foundation.org \
--cc=jaxboe@fusionio.com \
--cc=jmoyer@redhat.com \
--cc=jwboyer@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rjones@redhat.com \
--cc=torsten.hilbrich@secunet.com \
--cc=torvalds@linux-foundation.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®