All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Mason <clm@fb.com>
To: Liu Bo <bo.li.liu@oracle.com>
Cc: <axboe@fb.com>, <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] Btrfs: fix a bug of sleeping in atomic context
Date: Fri, 20 Nov 2015 15:09:21 -0500	[thread overview]
Message-ID: <20151120200921.GD9887@ret.masoncoding.com> (raw)
In-Reply-To: <20151120200633.GB10385@localhost.localdomain>

On Fri, Nov 20, 2015 at 12:06:33PM -0800, Liu Bo wrote:
> On Fri, Nov 20, 2015 at 09:57:49AM -0800, Liu Bo wrote:
> > On Fri, Nov 20, 2015 at 08:13:58AM -0500, Chris Mason wrote:
> > > On Thu, Nov 19, 2015 at 05:49:37PM -0800, Liu Bo wrote:
> > > > while xfstesting, this bug[1] is spotted by both btrfs/061 and btrfs/063,
> > > > so those sub-stripe writes are gatherred into plug callback list and
> > > > hopefully we can have a full stripe writes.
> > > > 
> > > > However, while processing these plugged callbacks, it's within an atomic
> > > > context which is provided by blk_sq_make_request() because of a get_cpu()
> > > > in blk_mq_get_ctx().
> > > > 
> > > > This changes to always use btrfs_rmw_helper to complete the pending writes.
> > > > 
> > > 
> > > Thanks Liu, but MD raid has the same troubles, we're not atomic in our unplugs.
> > 
> > Yeah, MD also does, but I don't see a way to change mq code at this
> > stage..
> 
> Correct it: MD raid5_unplug runs stripes inside a pair of spinlock (conf->device_lock) and moreover, those writes will be forwarded to raid5d to finish the job.
> 
> So md raid can run fine within atomic context.

Check MD raid10

-chris

  reply	other threads:[~2015-11-20 20:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-20  1:49 [PATCH] Btrfs: fix a bug of sleeping in atomic context Liu Bo
2015-11-20 13:13 ` Chris Mason
2015-11-20 17:57   ` Liu Bo
2015-11-20 20:06     ` Liu Bo
2015-11-20 20:09       ` Chris Mason [this message]
2015-11-20 21:30   ` Jens Axboe
2015-11-20 23:08     ` Liu Bo
2015-11-21  2:26       ` Jens Axboe
2015-11-21  3:14         ` Liu Bo
2015-11-21  3:29           ` Jens Axboe
2015-11-21  6:05             ` Liu Bo

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=20151120200921.GD9887@ret.masoncoding.com \
    --to=clm@fb.com \
    --cc=axboe@fb.com \
    --cc=bo.li.liu@oracle.com \
    --cc=linux-btrfs@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.