[PATCH] nvme: core: don't hold rcu read lock in nvme_ns_chr_uring_cmd_iopoll

Kanchan Joshi joshi.k at samsung.com
Tue Aug 8 23:59:20 PDT 2023


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 at 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.


More information about the Linux-nvme mailing list