* [PATCH] blk-mq: fix stale tag depth for shared sched tags in blk_mq_update_nr_requests()
@ 2025-10-15 1:48 Yu Kuai
2025-10-15 4:34 ` Nilay Shroff
` (4 more replies)
0 siblings, 5 replies; 9+ messages in thread
From: Yu Kuai @ 2025-10-15 1:48 UTC (permalink / raw)
To: axboe, clm, nilay
Cc: linux-block, linux-kernel, yukuai3, yukuai1, yi.zhang, yangerkun,
johnny.chenyi
Commit 7f2799c546db ("blk-mq: cleanup shared tags case in
blk_mq_update_nr_requests()") moves blk_mq_tag_update_sched_shared_tags()
before q->nr_requests is updated, however, it's still using the old
q->nr_requests to resize tag depth.
Fix this problem by passing in expected new tag depth.
Fixes: 7f2799c546db ("blk-mq: cleanup shared tags case in blk_mq_update_nr_requests()")
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
block/blk-mq-sched.c | 2 +-
block/blk-mq-tag.c | 5 +++--
block/blk-mq.c | 2 +-
block/blk-mq.h | 3 ++-
4 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c
index d06bb137a743..e0bed16485c3 100644
--- a/block/blk-mq-sched.c
+++ b/block/blk-mq-sched.c
@@ -557,7 +557,7 @@ int blk_mq_init_sched(struct request_queue *q, struct elevator_type *e,
if (blk_mq_is_shared_tags(flags)) {
/* Shared tags are stored at index 0 in @et->tags. */
q->sched_shared_tags = et->tags[0];
- blk_mq_tag_update_sched_shared_tags(q);
+ blk_mq_tag_update_sched_shared_tags(q, et->nr_requests);
}
queue_for_each_hw_ctx(q, hctx, i) {
diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c
index c7a4d4b9cc87..5b664dbdf655 100644
--- a/block/blk-mq-tag.c
+++ b/block/blk-mq-tag.c
@@ -622,10 +622,11 @@ void blk_mq_tag_resize_shared_tags(struct blk_mq_tag_set *set, unsigned int size
sbitmap_queue_resize(&tags->bitmap_tags, size - set->reserved_tags);
}
-void blk_mq_tag_update_sched_shared_tags(struct request_queue *q)
+void blk_mq_tag_update_sched_shared_tags(struct request_queue *q,
+ unsigned int nr)
{
sbitmap_queue_resize(&q->sched_shared_tags->bitmap_tags,
- q->nr_requests - q->tag_set->reserved_tags);
+ nr - q->tag_set->reserved_tags);
}
/**
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 09f579414161..d626d32f6e57 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -4941,7 +4941,7 @@ struct elevator_tags *blk_mq_update_nr_requests(struct request_queue *q,
* tags can't grow, see blk_mq_alloc_sched_tags().
*/
if (q->elevator)
- blk_mq_tag_update_sched_shared_tags(q);
+ blk_mq_tag_update_sched_shared_tags(q, nr);
else
blk_mq_tag_resize_shared_tags(set, nr);
} else if (!q->elevator) {
diff --git a/block/blk-mq.h b/block/blk-mq.h
index af42dc018808..c4fccdeb5441 100644
--- a/block/blk-mq.h
+++ b/block/blk-mq.h
@@ -186,7 +186,8 @@ void blk_mq_put_tag(struct blk_mq_tags *tags, struct blk_mq_ctx *ctx,
void blk_mq_put_tags(struct blk_mq_tags *tags, int *tag_array, int nr_tags);
void blk_mq_tag_resize_shared_tags(struct blk_mq_tag_set *set,
unsigned int size);
-void blk_mq_tag_update_sched_shared_tags(struct request_queue *q);
+void blk_mq_tag_update_sched_shared_tags(struct request_queue *q,
+ unsigned int nr);
void blk_mq_tag_wakeup_all(struct blk_mq_tags *tags, bool);
void blk_mq_queue_tag_busy_iter(struct request_queue *q, busy_tag_iter_fn *fn,
--
2.39.2
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] blk-mq: fix stale tag depth for shared sched tags in blk_mq_update_nr_requests()
2025-10-15 1:48 [PATCH] blk-mq: fix stale tag depth for shared sched tags in blk_mq_update_nr_requests() Yu Kuai
@ 2025-10-15 4:34 ` Nilay Shroff
2025-10-15 4:42 ` Ming Lei
` (3 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Nilay Shroff @ 2025-10-15 4:34 UTC (permalink / raw)
To: Yu Kuai, axboe, clm
Cc: linux-block, linux-kernel, yukuai1, yi.zhang, yangerkun,
johnny.chenyi
On 10/15/25 7:18 AM, Yu Kuai wrote:
> Commit 7f2799c546db ("blk-mq: cleanup shared tags case in
> blk_mq_update_nr_requests()") moves blk_mq_tag_update_sched_shared_tags()
> before q->nr_requests is updated, however, it's still using the old
> q->nr_requests to resize tag depth.
>
> Fix this problem by passing in expected new tag depth.
>
> Fixes: 7f2799c546db ("blk-mq: cleanup shared tags case in blk_mq_update_nr_requests()")
> Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Looks good to me:
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] blk-mq: fix stale tag depth for shared sched tags in blk_mq_update_nr_requests()
2025-10-15 1:48 [PATCH] blk-mq: fix stale tag depth for shared sched tags in blk_mq_update_nr_requests() Yu Kuai
2025-10-15 4:34 ` Nilay Shroff
@ 2025-10-15 4:42 ` Ming Lei
2025-10-15 13:48 ` Jens Axboe
` (2 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Ming Lei @ 2025-10-15 4:42 UTC (permalink / raw)
To: Yu Kuai
Cc: axboe, clm, nilay, linux-block, linux-kernel, yukuai1, yi.zhang,
yangerkun, johnny.chenyi
On Wed, Oct 15, 2025 at 9:56 AM Yu Kuai <yukuai3@huawei.com> wrote:
>
> Commit 7f2799c546db ("blk-mq: cleanup shared tags case in
> blk_mq_update_nr_requests()") moves blk_mq_tag_update_sched_shared_tags()
> before q->nr_requests is updated, however, it's still using the old
> q->nr_requests to resize tag depth.
>
> Fix this problem by passing in expected new tag depth.
>
> Fixes: 7f2799c546db ("blk-mq: cleanup shared tags case in blk_mq_update_nr_requests()")
> Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] blk-mq: fix stale tag depth for shared sched tags in blk_mq_update_nr_requests()
2025-10-15 1:48 [PATCH] blk-mq: fix stale tag depth for shared sched tags in blk_mq_update_nr_requests() Yu Kuai
2025-10-15 4:34 ` Nilay Shroff
2025-10-15 4:42 ` Ming Lei
@ 2025-10-15 13:48 ` Jens Axboe
2025-10-15 16:32 ` Yu Kuai
2025-10-15 13:51 ` Jens Axboe
2025-10-15 19:15 ` shinichiro.kawasaki
4 siblings, 1 reply; 9+ messages in thread
From: Jens Axboe @ 2025-10-15 13:48 UTC (permalink / raw)
To: Yu Kuai, clm, nilay
Cc: linux-block, linux-kernel, yukuai1, yi.zhang, yangerkun,
johnny.chenyi
On 10/14/25 7:48 PM, Yu Kuai wrote:
> Commit 7f2799c546db ("blk-mq: cleanup shared tags case in
> blk_mq_update_nr_requests()") moves blk_mq_tag_update_sched_shared_tags()
> before q->nr_requests is updated, however, it's still using the old
> q->nr_requests to resize tag depth.
>
> Fix this problem by passing in expected new tag depth.
Fix looks fine, but you really should add a Link to the bug report, and
also a Reported-by tag. I'll add those.
--
Jens Axboe
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] blk-mq: fix stale tag depth for shared sched tags in blk_mq_update_nr_requests()
2025-10-15 1:48 [PATCH] blk-mq: fix stale tag depth for shared sched tags in blk_mq_update_nr_requests() Yu Kuai
` (2 preceding siblings ...)
2025-10-15 13:48 ` Jens Axboe
@ 2025-10-15 13:51 ` Jens Axboe
2025-10-15 19:15 ` shinichiro.kawasaki
4 siblings, 0 replies; 9+ messages in thread
From: Jens Axboe @ 2025-10-15 13:51 UTC (permalink / raw)
To: clm, nilay, Yu Kuai
Cc: linux-block, linux-kernel, yukuai1, yi.zhang, yangerkun,
johnny.chenyi
On Wed, 15 Oct 2025 09:48:27 +0800, Yu Kuai wrote:
> Commit 7f2799c546db ("blk-mq: cleanup shared tags case in
> blk_mq_update_nr_requests()") moves blk_mq_tag_update_sched_shared_tags()
> before q->nr_requests is updated, however, it's still using the old
> q->nr_requests to resize tag depth.
>
> Fix this problem by passing in expected new tag depth.
>
> [...]
Applied, thanks!
[1/1] blk-mq: fix stale tag depth for shared sched tags in blk_mq_update_nr_requests()
commit: dc96cefef0d3032c69e46a21b345c60e56b18934
Best regards,
--
Jens Axboe
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] blk-mq: fix stale tag depth for shared sched tags in blk_mq_update_nr_requests()
2025-10-15 13:48 ` Jens Axboe
@ 2025-10-15 16:32 ` Yu Kuai
0 siblings, 0 replies; 9+ messages in thread
From: Yu Kuai @ 2025-10-15 16:32 UTC (permalink / raw)
To: Jens Axboe, Yu Kuai, clm, nilay
Cc: linux-block, linux-kernel, yukuai1, yi.zhang, yangerkun,
johnny.chenyi
Hi,
在 2025/10/15 21:48, Jens Axboe 写道:
> On 10/14/25 7:48 PM, Yu Kuai wrote:
>> Commit 7f2799c546db ("blk-mq: cleanup shared tags case in
>> blk_mq_update_nr_requests()") moves blk_mq_tag_update_sched_shared_tags()
>> before q->nr_requests is updated, however, it's still using the old
>> q->nr_requests to resize tag depth.
>>
>> Fix this problem by passing in expected new tag depth.
> Fix looks fine, but you really should add a Link to the bug report, and
> also a Reported-by tag. I'll add those.
Thanks! Sorry that I do forget about this.
Kuai
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] blk-mq: fix stale tag depth for shared sched tags in blk_mq_update_nr_requests()
2025-10-15 1:48 [PATCH] blk-mq: fix stale tag depth for shared sched tags in blk_mq_update_nr_requests() Yu Kuai
` (3 preceding siblings ...)
2025-10-15 13:51 ` Jens Axboe
@ 2025-10-15 19:15 ` shinichiro.kawasaki
2025-10-16 1:11 ` Shinichiro Kawasaki
4 siblings, 1 reply; 9+ messages in thread
From: shinichiro.kawasaki @ 2025-10-15 19:15 UTC (permalink / raw)
To: linux-block; +Cc: shinichiro.kawasaki, dennis.maisenbacher
[-- Attachment #1: Type: text/plain, Size: 390 bytes --]
Dear patch submitter,
Blktests CI has tested the following submission:
Status: FAILURE
Name: blk-mq: fix stale tag depth for shared sched tags in blk_mq_update_nr_requests()
Patchwork: https://patchwork.kernel.org/project/linux-block/list/?series=1011590&state=*
Run record: https://github.com/linux-blktests/linux-block/actions/runs/18524669753
Failed test cases: nvme/057
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] blk-mq: fix stale tag depth for shared sched tags in blk_mq_update_nr_requests()
2025-10-15 19:15 ` shinichiro.kawasaki
@ 2025-10-16 1:11 ` Shinichiro Kawasaki
2025-10-16 3:18 ` Yi Zhang
0 siblings, 1 reply; 9+ messages in thread
From: Shinichiro Kawasaki @ 2025-10-16 1:11 UTC (permalink / raw)
To: linux-block@vger.kernel.org; +Cc: Dennis Maisenbacher
On Oct 15, 2025 / 12:15, shinichiro.kawasaki@wdc.com wrote:
> Dear patch submitter,
>
> Blktests CI has tested the following submission:
> Status: FAILURE
> Name: blk-mq: fix stale tag depth for shared sched tags in blk_mq_update_nr_requests()
> Patchwork: https://patchwork.kernel.org/project/linux-block/list/?series=1011590&state=*
> Run record: https://github.com/linux-blktests/linux-block/actions/runs/18524669753
>
>
> Failed test cases: nvme/057
Blktests CI tested this patch and observed that the test case nvme/057 failed
with the loop transport due to the lockdep WARN below. However, the failure
symptom does not look releated to the patch.
This failure looks new to me. Actions for fix will be appreciated. I will
disable the test case for blktests CI.
[11280.536805] ======================================================
[11280.537957] WARNING: possible circular locking dependency detected
[11280.538987] 6.18.0-rc1 #1 Tainted: G E
[11280.539846] ------------------------------------------------------
[11280.540751] (udev-worker)/45976 is trying to acquire lock:
[11280.541614] ffff888100cc2148 ((wq_completion)kblockd){+.+.}-{0:0}, at: touch_wq_lockdep_map+0x7a/0x180
[11280.542862]
but task is already holding lock:
[11280.544086] ffff88812bc63358 (&disk->open_mutex){+.+.}-{4:4}, at: bdev_release+0x133/0x610
[11280.545176]
which lock already depends on the new lock.
[11280.546881]
the existing dependency chain (in reverse order) is:
[11280.548140]
-> #2 (&disk->open_mutex){+.+.}-{4:4}:
[11280.549314] __lock_acquire+0x56d/0xc20
[11280.550023] lock_acquire.part.0+0xb7/0x220
[11280.550746] __mutex_lock+0x1a6/0x2110
[11280.551469] nvme_partition_scan_work+0x8a/0x120 [nvme_core]
[11280.552362] process_one_work+0x854/0x1460
[11280.553087] worker_thread+0x5f3/0xfe0
[11280.553785] kthread+0x3a5/0x760
[11280.554463] ret_from_fork+0x2d3/0x3d0
[11280.555191] ret_from_fork_asm+0x1a/0x30
[11280.555918]
-> #1 ((work_completion)(&head->partition_scan_work)){+.+.}-{0:0}:
[11280.557334] __lock_acquire+0x56d/0xc20
[11280.558061] lock_acquire.part.0+0xb7/0x220
[11280.558818] process_one_work+0x7ed/0x1460
[11280.559600] worker_thread+0x5f3/0xfe0
[11280.560339] kthread+0x3a5/0x760
[11280.561024] ret_from_fork+0x2d3/0x3d0
[11280.561753] ret_from_fork_asm+0x1a/0x30
[11280.562504]
-> #0 ((wq_completion)kblockd){+.+.}-{0:0}:
[11280.563805] check_prev_add+0xeb/0xca0
[11280.564547] validate_chain+0x46e/0x560
[11280.565302] __lock_acquire+0x56d/0xc20
[11280.566084] lock_acquire.part.0+0xb7/0x220
[11280.566885] touch_wq_lockdep_map+0x93/0x180
[11280.567674] start_flush_work+0x67d/0xc10
[11280.568446] __flush_work+0xc6/0x1a0
[11280.569175] nvme_mpath_put_disk+0x4f/0xa0 [nvme_core]
[11280.570040] nvme_free_ns_head+0x23/0x160 [nvme_core]
[11280.570907] bdev_release+0x3be/0x610
[11280.571652] blkdev_release+0x11/0x20
[11280.572397] __fput+0x372/0xaa0
[11280.573118] fput_close_sync+0xe5/0x190
[11280.573869] __x64_sys_close+0x7d/0xd0
[11280.574617] do_syscall_64+0x97/0x800
[11280.575355] entry_SYSCALL_64_after_hwframe+0x76/0x7e
[11280.576194]
other info that might help us debug this:
[11280.577944] Chain exists of:
(wq_completion)kblockd --> (work_completion)(&head->partition_scan_work) --> &disk->open_mutex
[11280.580191] Possible unsafe locking scenario:
[11280.581402] CPU0 CPU1
[11280.582143] ---- ----
[11280.582892] lock(&disk->open_mutex);
[11280.583583] lock((work_completion)(&head->partition_scan_work));
[11280.584656] lock(&disk->open_mutex);
[11280.585537] lock((wq_completion)kblockd);
[11280.586260]
*** DEADLOCK ***
[11280.587885] 2 locks held by (udev-worker)/45976:
[11280.588645] #0: ffff88812bc63358 (&disk->open_mutex){+.+.}-{4:4}, at: bdev_release+0x133/0x610
[11280.589732] #1: ffffffff9f31f100 (rcu_read_lock){....}-{1:3}, at: start_flush_work+0x34/0xc10
[11280.590827]
stack backtrace:
[11280.591935] CPU: 3 UID: 0 PID: 45976 Comm: (udev-worker) Tainted: G E 6.18.0-rc1 #1 PREEMPT(lazy)
[11280.591943] Tainted: [E]=UNSIGNED_MODULE
[11280.591946] Hardware name: KubeVirt None/RHEL, BIOS 1.16.3-2.el9 04/01/2014
[11280.591955] Call Trace:
[11280.591968] <TASK>
[11280.591973] dump_stack_lvl+0x6e/0xa0
[11280.591982] print_circular_bug.cold+0x38/0x45
[11280.591994] check_noncircular+0x146/0x160
[11280.592005] check_prev_add+0xeb/0xca0
[11280.592013] validate_chain+0x46e/0x560
[11280.592022] __lock_acquire+0x56d/0xc20
[11280.592030] lock_acquire.part.0+0xb7/0x220
[11280.592035] ? touch_wq_lockdep_map+0x7a/0x180
[11280.592042] ? srso_alias_return_thunk+0x5/0xfbef5
[11280.592046] ? find_held_lock+0x2b/0x80
[11280.592050] ? srso_alias_return_thunk+0x5/0xfbef5
[11280.592054] ? lock_acquire+0xee/0x130
[11280.592060] ? touch_wq_lockdep_map+0x7a/0x180
[11280.592064] touch_wq_lockdep_map+0x93/0x180
[11280.592069] ? touch_wq_lockdep_map+0x7a/0x180
[11280.592072] ? start_flush_work+0x5ae/0xc10
[11280.592078] start_flush_work+0x67d/0xc10
[11280.592087] __flush_work+0xc6/0x1a0
[11280.592091] ? __pfx___flush_work+0x10/0x10
[11280.592096] ? srso_alias_return_thunk+0x5/0xfbef5
[11280.592099] ? find_held_lock+0x2b/0x80
[11280.592104] ? __pfx_wq_barrier_func+0x10/0x10
[11280.592118] ? __pfx___might_resched+0x10/0x10
[11280.592126] ? queue_work_on+0x8e/0xc0
[11280.592130] ? srso_alias_return_thunk+0x5/0xfbef5
[11280.592134] ? lockdep_hardirqs_on_prepare.part.0+0x9b/0x150
[11280.592138] ? srso_alias_return_thunk+0x5/0xfbef5
[11280.592147] nvme_mpath_put_disk+0x4f/0xa0 [nvme_core]
[11280.592166] nvme_free_ns_head+0x23/0x160 [nvme_core]
[11280.592183] ? srso_alias_return_thunk+0x5/0xfbef5
[11280.592188] bdev_release+0x3be/0x610
[11280.592197] blkdev_release+0x11/0x20
[11280.592202] __fput+0x372/0xaa0
[11280.592211] fput_close_sync+0xe5/0x190
[11280.592217] ? __pfx_fput_close_sync+0x10/0x10
[11280.592227] __x64_sys_close+0x7d/0xd0
[11280.592233] do_syscall_64+0x97/0x800
[11280.592237] ? __fput+0x504/0xaa0
[11280.592242] ? fput_close_sync+0xe5/0x190
[11280.592250] ? srso_alias_return_thunk+0x5/0xfbef5
[11280.592254] ? fput_close_sync+0xe5/0x190
[11280.592259] ? __pfx_fput_close_sync+0x10/0x10
[11280.592264] ? srso_alias_return_thunk+0x5/0xfbef5
[11280.592268] ? do_raw_spin_unlock+0x14a/0x1f0
[11280.592275] ? do_syscall_64+0x11b/0x800
[11280.592278] ? srso_alias_return_thunk+0x5/0xfbef5
[11280.592282] ? srso_alias_return_thunk+0x5/0xfbef5
[11280.592286] ? do_syscall_64+0x139/0x800
[11280.592290] ? srso_alias_return_thunk+0x5/0xfbef5
[11280.592294] ? do_syscall_64+0x11b/0x800
[11280.592297] ? srso_alias_return_thunk+0x5/0xfbef5
[11280.592302] ? srso_alias_return_thunk+0x5/0xfbef5
[11280.592306] ? do_syscall_64+0x139/0x800
[11280.592310] ? srso_alias_return_thunk+0x5/0xfbef5
[11280.592313] ? __x64_sys_symlinkat+0x165/0x1f0
[11280.592322] ? do_syscall_64+0x11b/0x800
[11280.592325] ? srso_alias_return_thunk+0x5/0xfbef5
[11280.592330] ? srso_alias_return_thunk+0x5/0xfbef5
[11280.592333] ? do_syscall_64+0x139/0x800
[11280.592338] ? srso_alias_return_thunk+0x5/0xfbef5
[11280.592341] ? do_syscall_64+0x139/0x800
[11280.592345] ? lockdep_hardirqs_on_prepare.part.0+0x9b/0x150
[11280.592351] entry_SYSCALL_64_after_hwframe+0x76/0x7e
[11280.592355] RIP: 0033:0x7fe0e347aae6
[11280.592361] Code: 5d e8 41 8b 93 08 03 00 00 59 5e 48 83 f8 fc 75 19 83 e2 39 83 fa 08 75 11 e8 26 ff ff ff 66 0f 1f 44 00 00 48 8b 45 10 0f 05 <48> 8b 5d f8 c9 c3 0f 1f 40 00 f3 0f 1e fa 55 48 89 e5 48 83 ec 08
[11280.592365] RSP: 002b:00007ffe6ca41920 EFLAGS: 00000202 ORIG_RAX: 0000000000000003
[11280.592378] RAX: ffffffffffffffda RBX: 00005640c8945570 RCX: 00007fe0e347aae6
[11280.592382] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000012
[11280.592387] RBP: 00007ffe6ca41940 R08: 0000000000000000 R09: 0000000000000000
[11280.592389] R10: 0000000000000000 R11: 0000000000000202 R12: 00005640c8f5f920
[11280.592392] R13: 00007ffe6ca41ca0 R14: 0000000000000000 R15: 0000000000000011
[11280.592405] </TASK>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] blk-mq: fix stale tag depth for shared sched tags in blk_mq_update_nr_requests()
2025-10-16 1:11 ` Shinichiro Kawasaki
@ 2025-10-16 3:18 ` Yi Zhang
0 siblings, 0 replies; 9+ messages in thread
From: Yi Zhang @ 2025-10-16 3:18 UTC (permalink / raw)
To: Shinichiro Kawasaki; +Cc: linux-block@vger.kernel.org, Dennis Maisenbacher
On Thu, Oct 16, 2025 at 9:11 AM Shinichiro Kawasaki
<shinichiro.kawasaki@wdc.com> wrote:
>
> On Oct 15, 2025 / 12:15, shinichiro.kawasaki@wdc.com wrote:
> > Dear patch submitter,
> >
> > Blktests CI has tested the following submission:
> > Status: FAILURE
> > Name: blk-mq: fix stale tag depth for shared sched tags in blk_mq_update_nr_requests()
> > Patchwork: https://patchwork.kernel.org/project/linux-block/list/?series=1011590&state=*
> > Run record: https://github.com/linux-blktests/linux-block/actions/runs/18524669753
> >
> >
> > Failed test cases: nvme/057
>
> Blktests CI tested this patch and observed that the test case nvme/057 failed
> with the loop transport due to the lockdep WARN below. However, the failure
> symptom does not look releated to the patch.
>
> This failure looks new to me. Actions for fix will be appreciated. I will
> disable the test case for blktests CI.
From the log, it seems it was similar to this one:
https://lore.kernel.org/linux-block/CAHj4cs8mJ+R_GmQm9R8ebResKAWUE8kF5+_WVg0v8zndmqd6BQ@mail.gmail.com/
>
> [11280.536805] ======================================================
> [11280.537957] WARNING: possible circular locking dependency detected
> [11280.538987] 6.18.0-rc1 #1 Tainted: G E
> [11280.539846] ------------------------------------------------------
> [11280.540751] (udev-worker)/45976 is trying to acquire lock:
> [11280.541614] ffff888100cc2148 ((wq_completion)kblockd){+.+.}-{0:0}, at: touch_wq_lockdep_map+0x7a/0x180
> [11280.542862]
> but task is already holding lock:
> [11280.544086] ffff88812bc63358 (&disk->open_mutex){+.+.}-{4:4}, at: bdev_release+0x133/0x610
> [11280.545176]
> which lock already depends on the new lock.
>
> [11280.546881]
> the existing dependency chain (in reverse order) is:
> [11280.548140]
> -> #2 (&disk->open_mutex){+.+.}-{4:4}:
> [11280.549314] __lock_acquire+0x56d/0xc20
> [11280.550023] lock_acquire.part.0+0xb7/0x220
> [11280.550746] __mutex_lock+0x1a6/0x2110
> [11280.551469] nvme_partition_scan_work+0x8a/0x120 [nvme_core]
> [11280.552362] process_one_work+0x854/0x1460
> [11280.553087] worker_thread+0x5f3/0xfe0
> [11280.553785] kthread+0x3a5/0x760
> [11280.554463] ret_from_fork+0x2d3/0x3d0
> [11280.555191] ret_from_fork_asm+0x1a/0x30
> [11280.555918]
> -> #1 ((work_completion)(&head->partition_scan_work)){+.+.}-{0:0}:
> [11280.557334] __lock_acquire+0x56d/0xc20
> [11280.558061] lock_acquire.part.0+0xb7/0x220
> [11280.558818] process_one_work+0x7ed/0x1460
> [11280.559600] worker_thread+0x5f3/0xfe0
> [11280.560339] kthread+0x3a5/0x760
> [11280.561024] ret_from_fork+0x2d3/0x3d0
> [11280.561753] ret_from_fork_asm+0x1a/0x30
> [11280.562504]
> -> #0 ((wq_completion)kblockd){+.+.}-{0:0}:
> [11280.563805] check_prev_add+0xeb/0xca0
> [11280.564547] validate_chain+0x46e/0x560
> [11280.565302] __lock_acquire+0x56d/0xc20
> [11280.566084] lock_acquire.part.0+0xb7/0x220
> [11280.566885] touch_wq_lockdep_map+0x93/0x180
> [11280.567674] start_flush_work+0x67d/0xc10
> [11280.568446] __flush_work+0xc6/0x1a0
> [11280.569175] nvme_mpath_put_disk+0x4f/0xa0 [nvme_core]
> [11280.570040] nvme_free_ns_head+0x23/0x160 [nvme_core]
> [11280.570907] bdev_release+0x3be/0x610
> [11280.571652] blkdev_release+0x11/0x20
> [11280.572397] __fput+0x372/0xaa0
> [11280.573118] fput_close_sync+0xe5/0x190
> [11280.573869] __x64_sys_close+0x7d/0xd0
> [11280.574617] do_syscall_64+0x97/0x800
> [11280.575355] entry_SYSCALL_64_after_hwframe+0x76/0x7e
> [11280.576194]
> other info that might help us debug this:
>
> [11280.577944] Chain exists of:
> (wq_completion)kblockd --> (work_completion)(&head->partition_scan_work) --> &disk->open_mutex
>
> [11280.580191] Possible unsafe locking scenario:
>
> [11280.581402] CPU0 CPU1
> [11280.582143] ---- ----
> [11280.582892] lock(&disk->open_mutex);
> [11280.583583] lock((work_completion)(&head->partition_scan_work));
> [11280.584656] lock(&disk->open_mutex);
> [11280.585537] lock((wq_completion)kblockd);
> [11280.586260]
> *** DEADLOCK ***
>
> [11280.587885] 2 locks held by (udev-worker)/45976:
> [11280.588645] #0: ffff88812bc63358 (&disk->open_mutex){+.+.}-{4:4}, at: bdev_release+0x133/0x610
> [11280.589732] #1: ffffffff9f31f100 (rcu_read_lock){....}-{1:3}, at: start_flush_work+0x34/0xc10
> [11280.590827]
> stack backtrace:
> [11280.591935] CPU: 3 UID: 0 PID: 45976 Comm: (udev-worker) Tainted: G E 6.18.0-rc1 #1 PREEMPT(lazy)
> [11280.591943] Tainted: [E]=UNSIGNED_MODULE
> [11280.591946] Hardware name: KubeVirt None/RHEL, BIOS 1.16.3-2.el9 04/01/2014
> [11280.591955] Call Trace:
> [11280.591968] <TASK>
> [11280.591973] dump_stack_lvl+0x6e/0xa0
> [11280.591982] print_circular_bug.cold+0x38/0x45
> [11280.591994] check_noncircular+0x146/0x160
> [11280.592005] check_prev_add+0xeb/0xca0
> [11280.592013] validate_chain+0x46e/0x560
> [11280.592022] __lock_acquire+0x56d/0xc20
> [11280.592030] lock_acquire.part.0+0xb7/0x220
> [11280.592035] ? touch_wq_lockdep_map+0x7a/0x180
> [11280.592042] ? srso_alias_return_thunk+0x5/0xfbef5
> [11280.592046] ? find_held_lock+0x2b/0x80
> [11280.592050] ? srso_alias_return_thunk+0x5/0xfbef5
> [11280.592054] ? lock_acquire+0xee/0x130
> [11280.592060] ? touch_wq_lockdep_map+0x7a/0x180
> [11280.592064] touch_wq_lockdep_map+0x93/0x180
> [11280.592069] ? touch_wq_lockdep_map+0x7a/0x180
> [11280.592072] ? start_flush_work+0x5ae/0xc10
> [11280.592078] start_flush_work+0x67d/0xc10
> [11280.592087] __flush_work+0xc6/0x1a0
> [11280.592091] ? __pfx___flush_work+0x10/0x10
> [11280.592096] ? srso_alias_return_thunk+0x5/0xfbef5
> [11280.592099] ? find_held_lock+0x2b/0x80
> [11280.592104] ? __pfx_wq_barrier_func+0x10/0x10
> [11280.592118] ? __pfx___might_resched+0x10/0x10
> [11280.592126] ? queue_work_on+0x8e/0xc0
> [11280.592130] ? srso_alias_return_thunk+0x5/0xfbef5
> [11280.592134] ? lockdep_hardirqs_on_prepare.part.0+0x9b/0x150
> [11280.592138] ? srso_alias_return_thunk+0x5/0xfbef5
> [11280.592147] nvme_mpath_put_disk+0x4f/0xa0 [nvme_core]
> [11280.592166] nvme_free_ns_head+0x23/0x160 [nvme_core]
> [11280.592183] ? srso_alias_return_thunk+0x5/0xfbef5
> [11280.592188] bdev_release+0x3be/0x610
> [11280.592197] blkdev_release+0x11/0x20
> [11280.592202] __fput+0x372/0xaa0
> [11280.592211] fput_close_sync+0xe5/0x190
> [11280.592217] ? __pfx_fput_close_sync+0x10/0x10
> [11280.592227] __x64_sys_close+0x7d/0xd0
> [11280.592233] do_syscall_64+0x97/0x800
> [11280.592237] ? __fput+0x504/0xaa0
> [11280.592242] ? fput_close_sync+0xe5/0x190
> [11280.592250] ? srso_alias_return_thunk+0x5/0xfbef5
> [11280.592254] ? fput_close_sync+0xe5/0x190
> [11280.592259] ? __pfx_fput_close_sync+0x10/0x10
> [11280.592264] ? srso_alias_return_thunk+0x5/0xfbef5
> [11280.592268] ? do_raw_spin_unlock+0x14a/0x1f0
> [11280.592275] ? do_syscall_64+0x11b/0x800
> [11280.592278] ? srso_alias_return_thunk+0x5/0xfbef5
> [11280.592282] ? srso_alias_return_thunk+0x5/0xfbef5
> [11280.592286] ? do_syscall_64+0x139/0x800
> [11280.592290] ? srso_alias_return_thunk+0x5/0xfbef5
> [11280.592294] ? do_syscall_64+0x11b/0x800
> [11280.592297] ? srso_alias_return_thunk+0x5/0xfbef5
> [11280.592302] ? srso_alias_return_thunk+0x5/0xfbef5
> [11280.592306] ? do_syscall_64+0x139/0x800
> [11280.592310] ? srso_alias_return_thunk+0x5/0xfbef5
> [11280.592313] ? __x64_sys_symlinkat+0x165/0x1f0
> [11280.592322] ? do_syscall_64+0x11b/0x800
> [11280.592325] ? srso_alias_return_thunk+0x5/0xfbef5
> [11280.592330] ? srso_alias_return_thunk+0x5/0xfbef5
> [11280.592333] ? do_syscall_64+0x139/0x800
> [11280.592338] ? srso_alias_return_thunk+0x5/0xfbef5
> [11280.592341] ? do_syscall_64+0x139/0x800
> [11280.592345] ? lockdep_hardirqs_on_prepare.part.0+0x9b/0x150
> [11280.592351] entry_SYSCALL_64_after_hwframe+0x76/0x7e
> [11280.592355] RIP: 0033:0x7fe0e347aae6
> [11280.592361] Code: 5d e8 41 8b 93 08 03 00 00 59 5e 48 83 f8 fc 75 19 83 e2 39 83 fa 08 75 11 e8 26 ff ff ff 66 0f 1f 44 00 00 48 8b 45 10 0f 05 <48> 8b 5d f8 c9 c3 0f 1f 40 00 f3 0f 1e fa 55 48 89 e5 48 83 ec 08
> [11280.592365] RSP: 002b:00007ffe6ca41920 EFLAGS: 00000202 ORIG_RAX: 0000000000000003
> [11280.592378] RAX: ffffffffffffffda RBX: 00005640c8945570 RCX: 00007fe0e347aae6
> [11280.592382] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000012
> [11280.592387] RBP: 00007ffe6ca41940 R08: 0000000000000000 R09: 0000000000000000
> [11280.592389] R10: 0000000000000000 R11: 0000000000000202 R12: 00005640c8f5f920
> [11280.592392] R13: 00007ffe6ca41ca0 R14: 0000000000000000 R15: 0000000000000011
> [11280.592405] </TASK>
>
--
Best Regards,
Yi Zhang
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2025-10-16 3:18 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-15 1:48 [PATCH] blk-mq: fix stale tag depth for shared sched tags in blk_mq_update_nr_requests() Yu Kuai
2025-10-15 4:34 ` Nilay Shroff
2025-10-15 4:42 ` Ming Lei
2025-10-15 13:48 ` Jens Axboe
2025-10-15 16:32 ` Yu Kuai
2025-10-15 13:51 ` Jens Axboe
2025-10-15 19:15 ` shinichiro.kawasaki
2025-10-16 1:11 ` Shinichiro Kawasaki
2025-10-16 3:18 ` Yi Zhang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox