dm-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: "axboe@kernel.dk" <axboe@kernel.dk>,
	device-mapper development <dm-devel@redhat.com>,
	"hch@lst.de" <hch@lst.de>
Subject: Re: [PATCH 8/9] dm: Fix two race conditions related to stopping and starting queues
Date: Thu, 1 Sep 2016 16:48:06 -0400	[thread overview]
Message-ID: <20160901204806.GA12742@redhat.com> (raw)
In-Reply-To: <889bdb89-a16b-927a-adf0-fa04418a0c06@sandisk.com>

On Thu, Sep 01 2016 at  4:39pm -0400,
Bart Van Assche <bart.vanassche@sandisk.com> wrote:

> On 09/01/2016 01:33 PM, Mike Snitzer wrote:
> >I'm able to easily reproduce this 100% cpu usage using mptest's
> >test_02_sdev_delete.
> >
> >'dmsetup suspend --nolockfs --noflush mp' hangs, seems rooted in your
> >use of blk_mq_freeze_queue():
> >
> >[  298.136930] dmsetup         D ffff880142cb3b70     0  9478   9414 0x00000080
> >[  298.144831]  ffff880142cb3b70 ffff880142cb3b28 ffff880330d6cb00 ffff88032d0022f8
> >[  298.153132]  ffff880142cb4000 ffff88032d0022f8 ffff88032b161800 0000000000000001
> >[  298.161438]  0000000000000001 ffff880142cb3b88 ffffffff816c06e5 ffff88032d001aa0
> >[  298.169740] Call Trace:
> >[  298.172473]  [<ffffffff816c06e5>] schedule+0x35/0x80
> >[  298.178019]  [<ffffffff8131b937>] blk_mq_freeze_queue_wait+0x57/0xc0
> >[  298.185116]  [<ffffffff810c58c0>] ? prepare_to_wait_event+0xf0/0xf0
> >[  298.192117]  [<ffffffff8131d92a>] blk_mq_freeze_queue+0x1a/0x20
> >[  298.198734]  [<ffffffffa000e910>] dm_stop_queue+0x50/0xc0 [dm_mod]
> >[  298.205644]  [<ffffffffa0001824>] __dm_suspend+0x134/0x1f0 [dm_mod]
> >[  298.212649]  [<ffffffffa00035b8>] dm_suspend+0xb8/0xd0 [dm_mod]
> >[  298.219270]  [<ffffffffa000882e>] dev_suspend+0x18e/0x240 [dm_mod]
> >[  298.226175]  [<ffffffffa00086a0>] ? table_load+0x380/0x380 [dm_mod]
> >[  298.233180]  [<ffffffffa0009027>] ctl_ioctl+0x1e7/0x4d0 [dm_mod]
> >[  298.239890]  [<ffffffff81197f00>] ? lru_cache_add_active_or_unevictable+0x10/0xb0
> >[  298.248253]  [<ffffffffa0009323>] dm_ctl_ioctl+0x13/0x20 [dm_mod]
> >[  298.255049]  [<ffffffff81227937>] do_vfs_ioctl+0xa7/0x5d0
> >[  298.261081]  [<ffffffff8112787f>] ? __audit_syscall_entry+0xaf/0x100
> >[  298.268178]  [<ffffffff8100365d>] ? syscall_trace_enter+0x1dd/0x2c0
> >[  298.275179]  [<ffffffff81227ed9>] SyS_ioctl+0x79/0x90
> >[  298.280821]  [<ffffffff81003a47>] do_syscall_64+0x67/0x160
> >[  298.286950]  [<ffffffff816c4921>] entry_SYSCALL64_slow_path+0x25/0x25
> >
> 
> Hello Mike,
> 
> In your dm-4.9 branch I see that you call blk_mq_freeze_queue()
> while holding the block layer queue lock. Please don't do this.
> blk_mq_freeze_queue() can sleep and as you know calling a sleeping
> function while holding a spinlock is not allowed.

Yeah, I since fixed that.  Doesn't change the fact that your use of
blk_mq_freeze_queue() causes the 100% cpu usage.

  reply	other threads:[~2016-09-01 20:48 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-31 22:14 [PATCH 0/9] dm patches for kernel v4.9 Bart Van Assche
2016-08-31 22:15 ` [PATCH 1/9] blk-mq: Introduce blk_mq_queue_stopped() Bart Van Assche
2016-08-31 22:16 ` [PATCH 2/9] dm: Rename a function argument Bart Van Assche
2016-09-01  3:29   ` Mike Snitzer
2016-09-01 14:17     ` Bart Van Assche
2016-08-31 22:16 ` [PATCH 3/9] dm: Introduce signal_pending_state() Bart Van Assche
2016-08-31 22:16 ` [PATCH 4/9] dm: Convert wait loops Bart Van Assche
2016-08-31 22:17 ` [PATCH 5/9] dm: Add two lockdep_assert_held() statements Bart Van Assche
2016-08-31 22:17 ` [PATCH 6/9] dm: Simplify dm_old_stop_queue() Bart Van Assche
2016-08-31 22:17 ` [PATCH 7/9] dm: Mark block layer queue dead before destroying the dm device Bart Van Assche
2016-08-31 22:18 ` [PATCH 8/9] dm: Fix two race conditions related to stopping and starting queues Bart Van Assche
2016-09-01  3:13   ` Mike Snitzer
2016-09-01 14:23     ` Bart Van Assche
2016-09-01 15:05       ` Mike Snitzer
2016-09-01 15:31         ` Bart Van Assche
2016-09-01 15:50           ` Mike Snitzer
2016-09-01 16:12             ` Mike Snitzer
2016-09-01 17:59               ` Bart Van Assche
2016-09-01 19:05                 ` Mike Snitzer
2016-09-01 19:35                   ` Mike Snitzer
2016-09-01 20:15                   ` Bart Van Assche
2016-09-01 20:33                     ` Mike Snitzer
2016-09-01 20:39                       ` Bart Van Assche
2016-09-01 20:48                         ` Mike Snitzer [this message]
2016-09-01 20:52                           ` Bart Van Assche
2016-09-01 21:17                             ` Mike Snitzer
2016-09-01 22:18                               ` Mike Snitzer
2016-09-01 22:22                                 ` Bart Van Assche
2016-09-01 22:26                                   ` Mike Snitzer
2016-09-01 23:17                                     ` Bart Van Assche
2016-09-01 23:47                                       ` Mike Snitzer
2016-09-02  0:03                                         ` Bart Van Assche
2016-09-02 15:12                                           ` Mike Snitzer
2016-09-02 16:10                                             ` should blk-mq halt requeue processing while queue is frozen? [was: Re: [PATCH 8/9] dm: Fix two race conditions related to stopping and starting queues] Mike Snitzer
2016-09-02 22:42                                               ` [dm-devel] should blk-mq halt requeue processing while queue is frozen? Bart Van Assche
2016-09-03  0:34                                                 ` Mike Snitzer
2016-09-07 16:41                                                 ` Mike Snitzer
2016-09-13  8:01                                                   ` [dm-devel] " Bart Van Assche
2016-09-13 14:36                                                     ` Mike Snitzer
2016-08-31 22:18 ` [PATCH 9/9] dm path selector: Avoid that device removal triggers an infinite loop Bart Van Assche
2016-09-01  2:49   ` Mike Snitzer
2016-09-01 14:14     ` Bart Van Assche
2016-09-01 15:06       ` Mike Snitzer
2016-09-01 15:22         ` Bart Van Assche
2016-09-01 15:26           ` Mike Snitzer

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=20160901204806.GA12742@redhat.com \
    --to=snitzer@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=bart.vanassche@sandisk.com \
    --cc=dm-devel@redhat.com \
    --cc=hch@lst.de \
    /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).