From: Marc MERLIN <marc@merlins.org>
To: Eric Wheeler <bcache@lists.ewheeler.net>
Cc: Coly Li <i@coly.li>,
linux-bcache@vger.kernel.org,
Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: 4.8.8, bcache deadlock and hard lockup
Date: Wed, 30 Nov 2016 08:46:46 -0800 [thread overview]
Message-ID: <20161130164646.d6ejlv72hzellddd@merlins.org> (raw)
In-Reply-To: <alpine.LRH.2.11.1611291255350.1914@mail.ewheeler.net>
+btrfs mailing list, see below why
On Tue, Nov 29, 2016 at 12:59:44PM -0800, Eric Wheeler wrote:
> On Mon, 27 Nov 2016, Coly Li wrote:
> >
> > Yes, too many work queues... I guess the locking might be caused by some
> > very obscure reference of closure code. I cannot have any clue if I
> > cannot find a stable procedure to reproduce this issue.
> >
> > Hmm, if there is a tool to clone all the meta data of the back end cache
> > and whole cached device, there might be a method to replay the oops much
> > easier.
> >
> > Eric, do you have any hint ?
>
> Note that the backing device doesn't have any metadata, just a superblock.
> You can easily dd that off onto some other volume without transferring the
> data. By default, data starts at 8k, or whatever you used in `make-bcache
> -w`.
Ok, Linus helped me find a workaround for this problem:
https://lkml.org/lkml/2016/11/29/667
namely:
echo 2 > /proc/sys/vm/dirty_ratio
echo 1 > /proc/sys/vm/dirty_background_ratio
(it's a 24GB system, so the defaults of 20 and 10 were creating too many
requests in th buffers)
Note that this is only a workaround, not a fix.
When I did this and re tried my big copy again, I still got 100+ kernel
work queues, but apparently the underlying swraid5 was able to unblock
and satisfy the write requests before too many accumulated and crashed
the kernel.
I'm not a kernel coder, but seems to me that bcache needs a way to
throttle incoming requests if there are too many so that it does not end
up in a state where things blow up due to too many piled up requests.
You should be able to reproduce this by taking 5 spinning rust drives,
put raid5 on top, dmcrypt, bcache and hopefully any filesystem (although
I used btrfs) and send lots of requests.
Actually to be honest, the problems have mostly been happening when I do
btrfs scrub and btrfs send/receive which both generate I/O from within
the kernel instead of user space.
So here, btrfs may be a contributor to the problem too, but while btrfs
still trashes my system if I remove the caching device on bcache (and
with the default dirty ratio values), it doesn't crash the kernel.
I'll start another separate thread with the btrfs folks on how much
pressure is put on the system, but on your side it would be good to help
ensure that bcache doesn't crash the system altogether if too many
requests are allowed to pile up.
Thanks,
Marc
--
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
.... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/ | PGP 1024R/763BE901
next prev parent reply other threads:[~2016-11-30 16:46 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-18 16:46 4.8.8, bcache deadlock and hard lockup Marc MERLIN
2016-11-18 18:49 ` Marc MERLIN
2016-11-20 21:13 ` Coly Li
2016-11-20 21:26 ` Marc MERLIN
2016-11-21 0:04 ` Marc MERLIN
2016-11-29 20:59 ` Eric Wheeler
2016-11-30 16:46 ` Marc MERLIN [this message]
2016-11-30 17:16 ` Marc MERLIN
2016-11-30 23:57 ` Eric Wheeler
2016-12-01 0:09 ` Marc MERLIN
2016-12-01 21:58 ` Eric Wheeler
2016-12-01 0:48 ` Chris Murphy
2016-12-01 12:30 ` Austin S. Hemmelgarn
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=20161130164646.d6ejlv72hzellddd@merlins.org \
--to=marc@merlins.org \
--cc=bcache@lists.ewheeler.net \
--cc=i@coly.li \
--cc=linux-bcache@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox