linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Mason <clm@fb.com>
To: Zach Brown <zab@zabbo.net>
Cc: <linux-btrfs@vger.kernel.org>
Subject: Re: readdir tree/page lock inversion
Date: Tue, 31 Mar 2015 21:39:21 -0400	[thread overview]
Message-ID: <1427852361.24929.2@mail.thefacebook.com> (raw)
In-Reply-To: <20150331234553.GA20542@lenny.home.zabbo.net>

On Tue, Mar 31, 2015 at 7:45 PM, Zach Brown <zab@zabbo.net> wrote:
> We've known for eons that it's not great that readdir holds tree locks
> while calling mkwrite by way of dir_emit().  I fiddled around and 
> found
> a reliable if goofy deadlock reproducer.  It typically takes a few
> seconds on modest hardware here (single package, dual core/ht, single
> spindle.)
> 
> I made a quick attempt at refactoring readdir to stage entries in a
> locally allocated page before releasing the locks and emitting them 
> but
> unfortunately my eyeballs fell out and one of the cats ran off with
> them.  Maybe someone else will have more luck.

Ok, copying into a temporary page (or just a temp extent buffer) really 
is the best way.  Basically copy out the extent buffer right after the 
btrfs_search_slot and then process the local copy.

I'll take a look for the merge window.

-chris




      reply	other threads:[~2015-04-01  1:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-31 23:45 readdir tree/page lock inversion Zach Brown
2015-04-01  1:39 ` Chris Mason [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=1427852361.24929.2@mail.thefacebook.com \
    --to=clm@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=zab@zabbo.net \
    /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).