linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mingming Cao <cmm@us.ibm.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Badari Pulavarty <pbadari@us.ibm.com>,
	linux-fsdevel@vger.kernel.org, sct@redhat.com
Subject: Re: kjournald() with DIO
Date: Tue, 13 Sep 2005 10:53:01 -0700	[thread overview]
Message-ID: <1126633981.4012.31.camel@localhost.localdomain> (raw)
In-Reply-To: <20050912172935.19907edf.akpm@osdl.org>

On Mon, 2005-09-12 at 17:29 -0700, Andrew Morton wrote:
> Badari Pulavarty <pbadari@us.ibm.com> wrote:
> >
> > Didn't help. How can this help ?
> 
> Oh well.  Different bug.  See http://bugzilla.kernel.org/show_bug.cgi?id=4964
> 
> > DIO code is kicking back to buffered mode, since its trying to
> > fill-in the holes. The fix you suggested might have helped, if
> > IO is beyond file size or file size not ending on page boundary.
> > What am I missing ?
> 
> Have you spoken with Mingming about this?  She's chasing a similar race. 
> She's currently working on getting the ext3-debug patch working so we can
> find out how those buffers (which apparently aren't even attached to the
> journal) came to have an elevated refcount.
> 
Hi Andrew, Badari was looking at the race with me and he came up with
some hack patch to "remember" who are the last two caller to get_bh(),
and once we found a buffer whose reference count is >1 but the journal
head is NULL, it start trace this bufferhead.(dump who is the last two
caller to get_bh())

The analysis results shows that there are race between
journal_try_to_free_buffers() and kjournald.  It possible that when
kjournald is waiting for a buffer unlocked, it released the journal-
>j_list_lock(commit.c, line 398), but it is still holding a reference
count on that buffer while wait_on_buffer().  This allowed the
__journal_try_to_free_buffer() to proceed (which is waiting for the
j_list_lock and will unlink the journal head from the buffer
eventually). journal_try_to_free_buffer() will call try_to_free_buffer()
if the journal head is NULL, at that point, since kjournald is still
holding a reference count on that buffer, try_to_free_buffers()-
>drop_buffers() failed because buffer is busy.


This race happened in SLES9 SP1/SP2, also it happend in 2.6.11, but
could not reproduce in mainline 2.6.13. SPLES9 sp1/sp2 and 2.6.11 all
have the patch to allow invalidate_inode_page() to return -EIO to deal
with the DIO-with-dirty-mapped-write case.  But in 2.6.13, it
invalidates using a range, probably that's why mainline doesn't 
show the problem (the chance of calling invalidate_inode_pages2_range on
a busy page is reduced if the range is passed as parameter)

> Apparently the debug patch is currently oopsing.  We need to fix that.

Sorry about the lack of response on this, it certainly very powerful and
useful tool. Last time I tried it again the kernel would not boot. I am
working on it, slowly:)

Mingming


  parent reply	other threads:[~2005-09-13 17:54 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
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 [this message]
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=1126633981.4012.31.camel@localhost.localdomain \
    --to=cmm@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=pbadari@us.ibm.com \
    --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).