Message ID | 20250318095548.5187-1-thomas.hellstrom@linux.intel.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [v2] block: Make request_queue lockdep splats show up earlier | expand |
Context | Check | Description |
---|---|---|
shin/vmtest-linus-master-PR | fail | PR summary |
shin/vmtest-linus-master-VM_Test-4 | success | Logs for run-tests-on-kernel |
shin/vmtest-linus-master-VM_Test-3 | success | Logs for run-tests-on-kernel |
shin/vmtest-linus-master-VM_Test-2 | success | Logs for run-tests-on-kernel |
shin/vmtest-linus-master-VM_Test-1 | success | Logs for build-kernel |
shin/vmtest-linus-master-VM_Test-0 | success | Logs for build-kernel |
On Tue, 18 Mar 2025 10:55:48 +0100, Thomas Hellström wrote: > In recent kernels, there are lockdep splats around the > struct request_queue::io_lockdep_map, similar to [1], but they > typically don't show up until reclaim with writeback happens. > > Having multiple kernel versions released with a known risc of kernel > deadlock during reclaim writeback should IMHO be addressed and > backported to -stable with the highest priority. > > [...] Applied, thanks! [1/1] block: Make request_queue lockdep splats show up earlier commit: ffa1e7ada456087c2402b37cd6b2863ced29aff0 Best regards,
diff --git a/block/blk-core.c b/block/blk-core.c index d6c4fa3943b5..138fc3dbff45 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -455,6 +455,12 @@ struct request_queue *blk_alloc_queue(struct queue_limits *lim, int node_id) lockdep_init_map(&q->q_lockdep_map, "&q->q_usage_counter(queue)", &q->q_lock_cls_key, 0); + /* Teach lockdep about lock ordering (reclaim WRT queue freeze lock). */ + fs_reclaim_acquire(GFP_KERNEL); + rwsem_acquire_read(&q->io_lockdep_map, 0, 0, _RET_IP_); + rwsem_release(&q->io_lockdep_map, _RET_IP_); + fs_reclaim_release(GFP_KERNEL); + q->nr_requests = BLKDEV_DEFAULT_RQ; return q;