From: Badari Pulavarty <pbadari@us.ibm.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Andrea Arcangeli <andrea@suse.de>,
cmm@us.ibm.com, linux-fsdevel@vger.kernel.org, sct@redhat.com
Subject: Re: kjournald() with DIO
Date: Thu, 15 Sep 2005 13:49:31 -0700 [thread overview]
Message-ID: <1126817371.14837.155.camel@dyn9047017102.beaverton.ibm.com> (raw)
In-Reply-To: <20050915133500.754a8b4d.akpm@osdl.org>
On Thu, 2005-09-15 at 13:35 -0700, Andrew Morton wrote:
> Andrea Arcangeli <andrea@suse.de> wrote:
> >
> > > Probably we could simulate ->releasepage(page) by using
> > > ->invalidatepage(page, PAGE_CACHE_SIZE), but that's relying on
> > > side-effects, or would need new semantics defined, or something.
> >
> > The problem is that one thing is the memory reclaim, one thing is the
> > invalidate_inode_pages and one thing is the truncate.
> >
> > They need three different behaviours.
>
> Yup.
>
> > But we've only two API to ask the fs to get rid of the buffers, one is
> > destroying dirty buffers, the other is non-blocking, we might need one
> > that is blocking and it isn't destroying dirty buffers.
> >
> > The "wait/gfpmask" parameter to releasepage is ignored by ext3, perhaps
> > we should change the semantics of that bit, and have it passed as
> > GFP_KERNEL only by the invalidate_inode_pages.
>
> That would work.
>
> > > I made releasepage() nonblocking to avoid blocking processes in the memory
> > > reclaim paths. Given that it's best-effort, it may as well just trylock
> > > everything it needs and give up if that doesn't work out.
> >
> > I agree the memory reclaim can remain nonblocking.
> >
> > However note that the failure here is in try_to_free_buffers because the
> > buffer is pinned by the journal code (it's not a trylock failing).
> > Buffer is BH_Mapped, BH_Req, BH_Uptodate (0x19) - nicely tracked by IBM.
>
> I'll need reminding - why was the buffer unfreeable? Because kjournald had
> a ref on it? Whereabouts is that happening?
>
>
kjournald() is commiting the transaction and doing IO to buffers, since
previous DIO write kicked it back to buffered mode (due to hole
filling).
Here is the race:
DIO Process kjounald()
journal_commit_transaction()
...
/* submited buffers for IO */
/* Waiting for IO to complete */
while (t_locked_list) {
...
get_bh(bh);
if (buffer_locked(bh)) {
spin_unlock(&journal->j_list_lock);
wait_on_buffer(bh);
invalidate_complete_page()
..
ext3_releasepage()
journal_try_to_free_buffers()
journal_put_journal_head()
__journal_try_to_free_buffer()
<--- freed jh
try_to_free_buffers()
drop_buffers()
if (buffer_busy(bh))
goto failed;
<<--- returns EIO due to b_count
next prev parent reply other threads:[~2005-09-15 20:51 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-12 23:23 kjournald() with DIO Badari Pulavarty
2005-09-12 23:37 ` Andrew Morton
2005-09-13 0:06 ` Badari Pulavarty
2005-09-13 0:29 ` Andrew Morton
2005-09-13 16:52 ` Badari Pulavarty
2005-09-13 23:07 ` Andrew Morton
2005-09-14 17:23 ` Mingming Cao
2005-09-14 18:18 ` Andrew Morton
2005-09-14 21:40 ` Mingming Cao
2005-09-14 22:02 ` Andrew Morton
2005-09-15 11:11 ` Suparna Bhattacharya
2005-09-15 18:52 ` Andrew Morton
2005-09-15 15:03 ` Badari Pulavarty
2005-09-15 19:22 ` Andrea Arcangeli
2005-09-15 20:00 ` Andrew Morton
2005-09-15 20:20 ` Andrea Arcangeli
2005-09-15 20:35 ` Andrew Morton
2005-09-15 20:49 ` Badari Pulavarty [this message]
2005-09-15 21:06 ` Andrea Arcangeli
2005-09-15 21:20 ` Andrew Morton
2005-09-15 22:22 ` Badari Pulavarty
2005-09-15 21:03 ` Andrea Arcangeli
2005-09-15 21:26 ` Andrew Morton
2005-09-15 22:04 ` Andrea Arcangeli
2005-09-15 23:28 ` Mingming Cao
2005-09-16 0:18 ` Andrea Arcangeli
2005-09-13 17:53 ` Mingming Cao
2005-09-16 13:42 ` Stephen C. Tweedie
2005-09-21 18:22 ` Mingming Cao
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=1126817371.14837.155.camel@dyn9047017102.beaverton.ibm.com \
--to=pbadari@us.ibm.com \
--cc=akpm@osdl.org \
--cc=andrea@suse.de \
--cc=cmm@us.ibm.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=sct@redhat.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;
as well as URLs for NNTP newsgroup(s).