public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Kanchan Joshi <joshi.k@samsung.com>
Cc: Christoph Hellwig <hch@lst.de>, Keith Busch <kbusch@kernel.org>,
	linux-nvme@lists.infradead.org, Sagi Grimberg <sagi@grimberg.me>,
	Guangwu Zhang <guazhang@redhat.com>,
	Anuj Gupta <anuj20.g@samsung.com>,
	ming.lei@redhat.com
Subject: Re: [PATCH] nvme: core: don't hold rcu read lock in nvme_ns_chr_uring_cmd_iopoll
Date: Thu, 10 Aug 2023 16:14:35 +0800	[thread overview]
Message-ID: <ZNSca/sJGA3zXpJ4@fedora> (raw)
In-Reply-To: <20230810063411.GA13970@green245>

On Thu, Aug 10, 2023 at 12:04:11PM +0530, Kanchan Joshi wrote:
> On Wed, Aug 09, 2023 at 03:53:35PM +0800, Ming Lei wrote:
> > On Wed, Aug 09, 2023 at 12:29:20PM +0530, Kanchan Joshi wrote:
> > > On Wed, Aug 09, 2023 at 10:04:40AM +0800, Ming Lei wrote:
> > > > Now nvme_ns_chr_uring_cmd_iopoll() has switched to request based io
> > > > polling, and the associated NS is guaranteed to be live in case of
> > > > io polling, so request is guaranteed to be valid because blk-mq uses
> > > > pre-allocated request pool.
> > > >
> > > > Remove the rcu read lock in nvme_ns_chr_uring_cmd_iopoll(), which
> > > > isn't needed any more after switching to request based io polling.
> > > 
> > > > Fix "BUG: sleeping function called from invalid context" because
> > > > set_page_dirty_lock() from blk_rq_unmap_user() may sleep.
> > > >
> > > > Fixes: 585079b6e425 ("nvme: wire up async polling for io passthrough commands")
> > > > Reported-by: Guangwu Zhang <guazhang@redhat.com>
> > > 
> > > Thanks Ming. Looks fine, but any link to this report?
> > > I don't see this breaking in my tests. So I wonder how to reproduce and
> > > improve the coverage.
> > 
> > It is reported in RH BZ2227639, and follows the stack trace:
> 
> Tried to access, but no luck.
> Any chance that steps can be posted here?

It is reported by Guang Wu, and I think it can be triggered by:

1) enable CONFIG_DEBUG_ATOMIC_SLEEP

2) run some nvme pt read workload, and fio should be fine, but
don't pass --fixedbufs

Just run a quick trace on set_page_dirty_lock() in non-debug kernel, which is
really called from bio_poll()<-nvme_ns_chr_uring_cmd_iopoll().

Thanks,
Ming



  reply	other threads:[~2023-08-10  8:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20230809020844epcas5p30e520491fa59ab8c20836d4275931e8f@epcas5p3.samsung.com>
2023-08-09  2:04 ` [PATCH] nvme: core: don't hold rcu read lock in nvme_ns_chr_uring_cmd_iopoll Ming Lei
2023-08-09  6:59   ` Kanchan Joshi
2023-08-09  7:53     ` Ming Lei
2023-08-10  6:34       ` Kanchan Joshi
2023-08-10  8:14         ` Ming Lei [this message]
2023-08-11 14:12   ` Jens Axboe
2023-08-11 14:12   ` Jens Axboe

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=ZNSca/sJGA3zXpJ4@fedora \
    --to=ming.lei@redhat.com \
    --cc=anuj20.g@samsung.com \
    --cc=guazhang@redhat.com \
    --cc=hch@lst.de \
    --cc=joshi.k@samsung.com \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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