linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [bug] __blk_mq_run_hw_queue suspicious rcu usage
@ 2019-09-04 21:40 David Rientjes
  2019-09-05  6:06 ` Christoph Hellwig
  0 siblings, 1 reply; 13+ messages in thread
From: David Rientjes @ 2019-09-04 21:40 UTC (permalink / raw)
  To: Tom Lendacky, Brijesh Singh, Christoph Hellwig, Jens Axboe, Ming Lei
  Cc: Peter Gonda, Jianxiong Gao, linux-kernel

Hi Christoph, Jens, and Ming,

While booting a 5.2 SEV-enabled guest we have encountered the following 
WARNING that is followed up by a BUG because we are in atomic context 
while trying to call set_memory_decrypted:

 WARNING: suspicious RCU usage
 5.2.0 #1 Not tainted
 -----------------------------
 include/linux/rcupdate.h:266 Illegal context switch in RCU read-side critical section!
 
 other info that might help us debug this:
 
 
 rcu_scheduler_active = 2, debug_locks = 1
 3 locks held by kworker/0:1H/97:
  #0: 0000000016e1b654 ((wq_completion)kblockd){+.+.}, at: process_one_work+0x1b5/0x5e0
  #1: 00000000002674ff ((work_completion)(&(&hctx->run_work)->work)){+.+.}, at: process_one_work+0x1b5/0x5e0
  #2: 00000000addb6aba (rcu_read_lock){....}, at: hctx_lock+0x17/0xe0
 
 stack backtrace:
 CPU: 0 PID: 97 Comm: kworker/0:1H Not tainted 5.2.0 #1
 Workqueue: kblockd blk_mq_run_work_fn
 Call Trace:
  dump_stack+0x67/0x90
  ___might_sleep+0xfb/0x180
  _vm_unmap_aliases+0x3e/0x1f0
  __set_memory_enc_dec+0x7b/0x120
  dma_direct_alloc_pages+0xcc/0x100
  dma_pool_alloc+0xcf/0x1e0
  nvme_queue_rq+0x5fb/0x9f0
  blk_mq_dispatch_rq_list+0x350/0x5a0
  blk_mq_do_dispatch_sched+0x76/0x110
  blk_mq_sched_dispatch_requests+0x119/0x170
  __blk_mq_run_hw_queue+0x6c/0xf0
  process_one_work+0x23b/0x5e0
  worker_thread+0x3d/0x390
  kthread+0x121/0x140
  ret_from_fork+0x27/0x50

hctx_lock() in __blk_mq_run_hw_queue() takes rcu_read_lock or 
srcu_read_lock depending on BLK_MQ_F_BLOCKING.

dma_direct_alloc_pages() can then call set_memory_decrypted() which must 
be allowed to block.

Any ideas on how to address this?

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-12-15  5:38 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-04 21:40 [bug] __blk_mq_run_hw_queue suspicious rcu usage David Rientjes
2019-09-05  6:06 ` Christoph Hellwig
2019-09-05 22:37   ` David Rientjes
2019-09-16 23:45     ` David Rientjes
2019-09-17 18:23       ` David Rientjes
2019-09-17 18:32         ` Jens Axboe
2019-09-17 18:41         ` Lendacky, Thomas
2019-09-18 13:22           ` Christoph Hellwig
2019-11-27 22:11             ` David Rientjes
2019-11-28  6:40               ` Christoph Hellwig
2019-12-13  0:07                 ` David Rientjes
2019-12-13  9:33                   ` David Rientjes
2019-12-15  5:38                   ` David Rientjes

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