Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Chris Mason <chris.mason@oracle.com>
To: cmm@us.ibm.com
Cc: rwheeler@redhat.com, linux-btrfs@vger.kernel.org
Subject: Re: btrfs panic - BUG: soft lockup - CPU#0 stuck for 61s! [fs_mark:4573]
Date: Mon, 09 Jun 2008 20:47:28 -0400	[thread overview]
Message-ID: <1213058848.10187.129.camel@think.oraclecorp.com> (raw)
In-Reply-To: <1213056641.3670.54.camel@localhost.localdomain>

On Mon, 2008-06-09 at 17:10 -0700, Mingming Cao wrote:
> On Sun, 2008-06-08 at 22:37 -0400, Chris Mason wrote:
> > On Thu, 05 Jun 2008 13:43:48 -0400
> > Ric Wheeler <rwheeler@redhat.com> wrote:
> > 
> > > Chris Mason wrote:
> > > > On Mon, Jun 02, 2008 at 01:52:47PM -0400, Ric Wheeler wrote:
> > > >   
> > > >> I can reliably get btrfs to panic by running my fs_mark code on a
> > > >> newly created file system with lots of threads on an 8-way box. If
> > > >> this is too aggressive, let me know ;-)
> > > >>
> > > >> Here is a summary of the panic:
> > > >>     
> > > >
> > > > BTW, exactly how are you running fs_mark?  Mingming reminded me that
> > > > strictly speaking this patch shouldn't be required, so there might
> > > > be other related problems.
> > > >
> > > > -chris
> > > >
> > > >   
> > > It still crashes, Mingming is clearly correct ;-)
> > > 
> > 
> > Grin, I never should have doubted her.
> > 
> :) 
> 
> > So, the actual fix should be below.  It looks like the problem is that I've got
> > a race in setting the pointer to a new transaction, which makes the
> > data=ordered code take a spin lock that hasn't yet been setup.
> > 
> 
> Just to be clear, so the data=ordered code(btrfs_del_ordered_inode())
> takes a spin lock (new_trans_lock) and assume the new transaction has
> been setup, that races with join_transaction resetting the current
> running transaction()? 
> 
Yes

> I also see the btrfs_commit_transaction() could reset the
> root->fs_info->running_transaction to be NULL, but we did not check NULL
> pointer in the data=ordered mode code, is this a potential Bug? Or it is
> covered somewhere else?
> 

Thanks for double checking these.

We don't check it in btrfs_add_ordered_inode because that must be called
with the transaction running.

btrfs_ordered_throttle is safe because it doesn't actually deref the
pointer, it just checks for changes to it.  The important part of
ordered_throttle is the writeback count.

So, the others should be safe, but please let me know if you see any
holes there.

-chris



  reply	other threads:[~2008-06-10  0:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-02 17:52 btrfs panic - BUG: soft lockup - CPU#0 stuck for 61s! [fs_mark:4573] Ric Wheeler
2008-06-04  1:27 ` Chris Mason
2008-06-04 19:46   ` Ric Wheeler
2008-06-04 20:12     ` Chris Mason
2008-06-05 14:34 ` Chris Mason
2008-06-05 15:16   ` Ric Wheeler
     [not found]   ` <484825D4.2010402@redhat.com>
2008-06-09  2:37     ` Chris Mason
2008-06-09 13:51       ` Ric Wheeler
2008-06-10  0:10       ` Mingming Cao
2008-06-10  0:47         ` Chris Mason [this message]
2008-06-10 18:38           ` 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=1213058848.10187.129.camel@think.oraclecorp.com \
    --to=chris.mason@oracle.com \
    --cc=cmm@us.ibm.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=rwheeler@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