From: Dan Carpenter <error27@gmail.com>
To: Luis Chamberlain <mcgrof@kernel.org>
Cc: Christoph Hellwig <hch@infradead.org>,
Jens Axboe <axboe@kernel.dk>,
Julia Lawall <julia.lawall@inria.fr>,
Linus Torvalds <torvalds@linux-foundation.org>,
Hongchen Zhang <zhanghongchen@loongson.cn>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Andrew Morton <akpm@linux-foundation.org>,
"Christian Brauner (Microsoft)" <brauner@kernel.org>,
David Howells <dhowells@redhat.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Eric Dumazet <edumazet@google.com>,
"Fabio M. De Francesco" <fmdefrancesco@gmail.com>,
Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
maobibo <maobibo@loongson.cn>,
Matthew Wilcox <willy@infradead.org>,
Sedat Dilek <sedat.dilek@gmail.com>
Subject: Re: [PATCH v4] pipe: use __pipe_{lock,unlock} instead of spinlock
Date: Tue, 7 Feb 2023 10:02:19 +0300 [thread overview]
Message-ID: <Y+H3eyrHFvv0tl50@kadam> (raw)
In-Reply-To: <Y+E+57DfSM9mW62+@bombadil.infradead.org>
On Mon, Feb 06, 2023 at 09:54:47AM -0800, Luis Chamberlain wrote:
> > block/blk-mq.c:4083 blk_mq_destroy_queue() warn: sleeping in atomic context
>
> Let's see as an example.
>
> blk_mq_exit_hctx() can spin_lock() and so could disable preemption but I
> can't see why this is sleeping in atomic context.
>
I should have said, the lines are from linux-next.
block/blk-mq.c
4078 void blk_mq_destroy_queue(struct request_queue *q)
4079 {
4080 WARN_ON_ONCE(!queue_is_mq(q));
4081 WARN_ON_ONCE(blk_queue_registered(q));
4082
4083 might_sleep();
^^^^^^^^^^^^^^
This is a weird example because today's cross function DB doesn't say
which function disables preemption. The output from `smdb.py preempt
blk_mq_destroy_queue` says:
nvme_remove_admin_tag_set()
nvme_remove_io_tag_set()
-> blk_mq_destroy_queue()
I would have assumed that nothing is disabling preempt and the
information just hasn't propagated through the call tree yet. However
yesterday's DB has enough information to show why the warning is
generated.
nvme_fc_match_disconn_ls() takes spin_lock_irqsave(&rport->lock, flags);
-> nvme_fc_ctrl_put(ctrl);
-> kref_put(&ctrl->ref, nvme_fc_ctrl_free);
-> nvme_remove_admin_tag_set(&ctrl->ctrl);
-> blk_mq_destroy_queue(ctrl->admin_q);
-> blk_mq_destroy_queue() <-- sleeps
It's the link between kref_put() and nvme_fc_ctrl_free() where the data
gets lost in today's DB. kref_put() is tricky to handle. I'm just
puzzled why it worked yesterday.
regards,
dan carpenter
next prev parent reply other threads:[~2023-02-07 7:03 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-29 6:04 [PATCH v4] pipe: use __pipe_{lock,unlock} instead of spinlock Hongchen Zhang
2023-01-29 7:33 ` Linus Torvalds
2023-02-03 2:24 ` Hongchen Zhang
2023-02-06 15:58 ` Luis Chamberlain
2023-02-06 16:07 ` Linus Torvalds
2023-02-06 16:13 ` Julia Lawall
2023-02-06 16:45 ` Dan Carpenter
2023-02-06 17:54 ` Luis Chamberlain
2023-02-07 7:02 ` Dan Carpenter [this message]
2023-02-06 18:25 ` Linus Torvalds
2023-02-07 13:37 ` xen: sleeping in atomic warnings Dan Carpenter
2023-02-07 14:03 ` Juergen Gross
2023-02-07 14:06 ` block: " Dan Carpenter
2023-02-07 16:15 ` Linus Torvalds
2023-02-07 17:53 ` Eric Biggers
2023-02-07 18:24 ` Linus Torvalds
2023-02-07 18:36 ` Eric Biggers
2023-02-07 18:57 ` Linus Torvalds
2023-02-07 19:09 ` Linus Torvalds
2023-02-07 19:35 ` Eric Biggers
2023-02-07 19:49 ` Linus Torvalds
2023-02-08 6:53 ` Eric Biggers
2023-02-07 18:31 ` Jens Axboe
2023-02-08 3:15 ` Yu Kuai
2023-02-03 1:42 ` [PATCH v4] pipe: use __pipe_{lock,unlock} instead of spinlock Hongchen Zhang
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=Y+H3eyrHFvv0tl50@kadam \
--to=error27@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=brauner@kernel.org \
--cc=christophe.jaillet@wanadoo.fr \
--cc=dhowells@redhat.com \
--cc=edumazet@google.com \
--cc=fmdefrancesco@gmail.com \
--cc=hch@infradead.org \
--cc=julia.lawall@inria.fr \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maobibo@loongson.cn \
--cc=mcgrof@kernel.org \
--cc=mchehab@kernel.org \
--cc=sedat.dilek@gmail.com \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.org \
--cc=zhanghongchen@loongson.cn \
/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