diff options
| author | Nilay Shroff <[email protected]> | 2025-07-30 07:46:09 +0000 |
|---|---|---|
| committer | Jens Axboe <[email protected]> | 2025-07-30 12:20:51 +0000 |
| commit | 04225d13aef11b2a539014def5e47d8c21fd74a5 (patch) | |
| tree | 322bda04c657a2aaee282737e32b35afa0be17e1 /lib/timerqueue.c | |
| parent | block: fix lockdep warning caused by lock dependency in elv_iosched_store (diff) | |
| download | kernel-04225d13aef11b2a539014def5e47d8c21fd74a5.tar.gz kernel-04225d13aef11b2a539014def5e47d8c21fd74a5.zip | |
block: fix potential deadlock while running nr_hw_queue update
Move scheduler tags (sched_tags) allocation and deallocation outside
both the ->elevator_lock and ->freeze_lock when updating nr_hw_queues.
This change breaks the dependency chain from the percpu allocator lock
to the elevator lock, helping to prevent potential deadlocks, as
observed in the reported lockdep splat[1].
This commit introduces batch allocation and deallocation helpers for
sched_tags, which are now used from within __blk_mq_update_nr_hw_queues
routine while iterating through the tagset.
With this change, all sched_tags memory management is handled entirely
outside the ->elevator_lock and the ->freeze_lock context, thereby
eliminating the lock dependency that could otherwise manifest during
nr_hw_queues updates.
[1] https://lore.kernel.org/all/[email protected]/
Reported-by: Stefan Haberland <[email protected]>
Closes: https://lore.kernel.org/all/[email protected]/
Reviewed-by: Ming Lei <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Nilay Shroff <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'lib/timerqueue.c')
0 files changed, 0 insertions, 0 deletions
