Linux block layer
 help / color / mirror / Atom feed
From: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
To: Bart Van Assche <bvanassche@acm.org>
Cc: linux-block@vger.kernel.org
Subject: Re: [PATCH blktests v3 0/2] Add an NBD performance test
Date: Thu, 3 Dec 2026 09:23:07 +0900	[thread overview]
Message-ID: <axC0sbhx9y1UCNyw@shinmob> (raw)
In-Reply-To: <20261129235238.3445710-1-bvanassche@acm.org>

On Nov 29, 2026 / 15:52, Bart Van Assche wrote:
> Hi Shin'ichiro,
> 
> This patch series adds an NBD performance test. Please consider it for
> inclusion in blktests.
> 
> Thanks,
> 
> Bart.
> 
> Changes compared to v2:
>  - Detect Unix domain socket support also if "nbd-client --help" only
>    mentions the -u option.
>  - Removed the _init_null_blk call since _configure_null_blk loads the
>    null_blk driver if necessary.
>  - Enable io_uring while fio runs since some test environments disable
>    io_uring by default.
>  - Use long grep options instead of short options.
>  - See also
>    https://lore.kernel.org/linux-block/20261120213434.2945873-1-bvanassche@acm.org/

Thanks, I applied the series. Of note is that I renumbered the new test case
from nbd/006 to nbd/005.

BTW, I found that this test case causes a lockdep WARN below. In that sense,
this test case is good not only for performance testing, but also exercising
block layer. The WARN was observed with v7.4-rc5 and v7.3 kernels. I'm not sure
who to ask, but help to avoid the WARN will be appreciated.


[   91.130638] [   T1076] run blktests nbd/005 at 2026-12-03 09:12:45.185630199
[   91.257005] [   T1076] null_blk: disk nullb1 created
[   91.751364] [   T1145] nbd0: detected capacity change from 0 to 2097152

[   93.662037] [   T1160] ======================================================
[   93.663326] [   T1160] WARNING: possible circular locking dependency detected
[   93.664473] [   T1160] 7.4.0-rc5 #506 Not tainted
[   93.665284] [   T1160] ------------------------------------------------------
[   93.666446] [   T1160] fio/1160 is trying to acquire lock:
[   93.667351] [   T1160] ffff88812f7762a8 (&q->elevator_lock){+.+.}-{4:4}, at: elevator_change+0x197/0x500
[   93.668870] [   T1160] 
                          but task is already holding lock:
[   93.670060] [   T1160] ffff88812f775d80 (&q->q_usage_counter(io)#23){++++}-{0:0}, at: blk_mq_freeze_queue_nomemsave+0x12/0x20
[   93.671863] [   T1160] 
                          which lock already depends on the new lock.

[   93.673544] [   T1160] 
                          the existing dependency chain (in reverse order) is:
[   93.675267] [   T1160] 
                          -> #5 (&q->q_usage_counter(io)#23){++++}-{0:0}:
[   93.676989] [   T1160]        blk_alloc_queue+0x605/0x7a0
[   93.678052] [   T1160]        blk_mq_alloc_queue+0x168/0x270
[   93.679154] [   T1160]        __blk_mq_alloc_disk+0x14/0xd0
[   93.680251] [   T1160]        nbd_dev_add+0x3fa/0xa70 [nbd]
[   93.681352] [   T1160]        0xffffffffc0dfe169
[   93.682253] [   T1160]        do_one_initcall+0x11a/0x540
[   93.683291] [   T1160]        do_init_module+0x2b3/0x8a0
[   93.684319] [   T1160]        load_module+0x5e05/0x73d0
[   93.685346] [   T1160]        init_module_from_file+0x11f/0x1a0
[   93.686502] [   T1160]        idempotent_init_module+0x37f/0x7c0
[   93.687531] [   T1160]        __x64_sys_finit_module+0xdb/0x190
[   93.688497] [   T1160]        do_syscall_64+0xf4/0x6b0
[   93.689339] [   T1160]        entry_SYSCALL_64_after_hwframe+0x76/0x7e
[   93.690418] [   T1160] 
                          -> #4 (fs_reclaim){+.+.}-{0:0}:
[   93.691611] [   T1160]        fs_reclaim_acquire+0xd5/0x120
[   93.692524] [   T1160]        kmem_cache_alloc_noprof+0x70/0x6a0
[   93.693459] [   T1160]        alloc_empty_file+0x56/0x180
[   93.694655] [   T1160]        dentry_open+0x38/0x90
[   93.695759] [   T1160]        pidfs_alloc_file+0x102/0x1c0
[   93.696959] [   T1160]        pidfd_prepare+0xb9/0x160
[   93.698067] [   T1160]        scm_pidfd_recv+0x12c/0x260
[   93.699102] [   T1160]        scm_recv_unix+0x202/0x310
[   93.700120] [   T1160]        __unix_dgram_recvmsg+0x655/0xb80
[   93.701232] [   T1160]        sock_recvmsg+0x167/0x1c0
[   93.702253] [   T1160]        ____sys_recvmsg+0x192/0x570
[   93.703282] [   T1160]        ___sys_recvmsg+0x160/0x1f0
[   93.704243] [   T1160]        __sys_recvmsg+0x125/0x1d0
[   93.705192] [   T1160]        do_syscall_64+0xf4/0x6b0
[   93.706109] [   T1160]        entry_SYSCALL_64_after_hwframe+0x76/0x7e
[   93.707209] [   T1160] 
                          -> #3 (&u->iolock){+.+.}-{4:4}:
[   93.708686] [   T1160]        __mutex_lock+0x1a9/0x2550
[   93.709619] [   T1160]        unix_stream_read_generic+0x34d/0x2b30
[   93.710668] [   T1160]        unix_stream_recvmsg+0x162/0x210
[   93.711655] [   T1160]        sock_recvmsg+0x167/0x1c0
[   93.712573] [   T1160]        __sock_xmit+0x3ea/0x5b0 [nbd]
[   93.713546] [   T1160]        nbd_handle_reply+0x6fd/0xe80 [nbd]
[   93.714568] [   T1160]        recv_work+0x214/0x770 [nbd]
[   93.715511] [   T1160]        process_one_work+0x96a/0x1790
[   93.716466] [   T1160]        worker_thread+0x5fd/0xfe0
[   93.717378] [   T1160]        kthread+0x36d/0x470
[   93.718217] [   T1160]        ret_from_fork+0x653/0x9d0
[   93.719114] [   T1160]        ret_from_fork_asm+0x1a/0x30
[   93.720030] [   T1160] 
                          -> #2 (&cmd->lock){+.+.}-{4:4}:
[   93.721415] [   T1160]        __mutex_lock+0x1a9/0x2550
[   93.722307] [   T1160]        nbd_queue_rq+0xc7/0xe00 [nbd]
[   93.723241] [   T1160]        blk_mq_dispatch_rq_list+0x3e0/0x2400
[   93.724243] [   T1160]        __blk_mq_sched_dispatch_requests+0xb0e/0x15d0
[   93.725338] [   T1160]        blk_mq_sched_dispatch_requests+0xab/0x150
[   93.726395] [   T1160]        blk_mq_run_work_fn+0x130/0x2e0
[   93.727370] [   T1160]        process_one_work+0x96a/0x1790
[   93.728314] [   T1160]        worker_thread+0x5fd/0xfe0
[   93.729203] [   T1160]        kthread+0x36d/0x470
[   93.730016] [   T1160]        ret_from_fork+0x653/0x9d0
[   93.730887] [   T1160]        ret_from_fork_asm+0x1a/0x30
[   93.731774] [   T1160] 
                          -> #1 (set->srcu){.+.+}-{0:0}:
[   93.733138] [   T1160]        __synchronize_srcu+0xe1/0x340
[   93.734051] [   T1160]        elevator_switch+0x13b/0x670
[   93.734942] [   T1160]        elevator_change+0x2e7/0x500
[   93.735829] [   T1160]        elevator_set_default+0x293/0x350
[   93.736761] [   T1160]        blk_register_queue+0x436/0x5e0
[   93.737696] [   T1160]        __add_disk+0x6a3/0xe30
[   93.738555] [   T1160]        add_disk_fwnode+0x11e/0x480
[   93.739461] [   T1160]        nbd_dev_add+0x6a5/0xa70 [nbd]
[   93.740391] [   T1160]        0xffffffffc0dfe169
[   93.741207] [   T1160]        do_one_initcall+0x11a/0x540
[   93.742125] [   T1160]        do_init_module+0x2b3/0x8a0
[   93.743046] [   T1160]        load_module+0x5e05/0x73d0
[   93.743925] [   T1160]        init_module_from_file+0x11f/0x1a0
[   93.744877] [   T1160]        idempotent_init_module+0x37f/0x7c0
[   93.745833] [   T1160]        __x64_sys_finit_module+0xdb/0x190
[   93.746777] [   T1160]        do_syscall_64+0xf4/0x6b0
[   93.747651] [   T1160]        entry_SYSCALL_64_after_hwframe+0x76/0x7e
[   93.748689] [   T1160] 
                          -> #0 (&q->elevator_lock){+.+.}-{4:4}:
[   93.750168] [   T1160]        __lock_acquire+0xe68/0x2490
[   93.751072] [   T1160]        lock_acquire+0x1b1/0x340
[   93.751959] [   T1160]        __mutex_lock+0x1a9/0x2550
[   93.752956] [   T1160]        elevator_change+0x197/0x500
[   93.753860] [   T1160]        elv_iosched_store+0x364/0x410
[   93.754775] [   T1160]        queue_attr_store+0x25f/0x3e0
[   93.755707] [   T1160]        kernfs_fop_write_iter+0x3d6/0x5e0
[   93.756710] [   T1160]        vfs_write+0x4b3/0xf30
[   93.757584] [   T1160]        ksys_write+0x112/0x250
[   93.758457] [   T1160]        do_syscall_64+0xf4/0x6b0
[   93.759338] [   T1160]        entry_SYSCALL_64_after_hwframe+0x76/0x7e
[   93.760371] [   T1160] 
                          other info that might help us debug this:

[   93.762329] [   T1160] Chain exists of:
                            &q->elevator_lock --> fs_reclaim --> &q->q_usage_counter(io)#23

[   93.764766] [   T1160]  Possible unsafe locking scenario:

[   93.766282] [   T1160]        CPU0                    CPU1
[   93.767221] [   T1160]        ----                    ----
[   93.768156] [   T1160]   lock(&q->q_usage_counter(io)#23);
[   93.769075] [   T1160]                                lock(fs_reclaim);
[   93.770156] [   T1160]                                lock(&q->q_usage_counter(io)#23);
[   93.771410] [   T1160]   lock(&q->elevator_lock);
[   93.772249] [   T1160] 
                           *** DEADLOCK ***

[   93.773979] [   T1160] locks held by fio/1160: 6, on CPU#1:
[   93.774895] [   T1160]  #0: ffff888103714478 (sb_writers#4){.+.+}-{0:0}, at: ksys_write+0x112/0x250
[   93.776257] [   T1160]  #1: ffff88813617dc80 (&of->mutex#2){+.+.}-{4:4}, at: kernfs_fop_write_iter+0x257/0x5e0
[   93.777744] [   T1160]  #2: ffff88811cc1d2d8 (kn->active#79){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x2ad/0x5e0
[   93.779244] [   T1160]  #3: ffff8881263b49c0 (&set->update_nr_hwq_lock){++++}-{4:4}, at: elv_iosched_store+0x283/0x410
[   93.780854] [   T1160]  #4: ffff88812f775d80 (&q->q_usage_counter(io)#23){++++}-{0:0}, at: blk_mq_freeze_queue_nomemsave+0x12/0x20
[   93.782558] [   T1160]  #5: ffff88812f775db8 (&q->q_usage_counter(queue)#15){+.+.}-{0:0}, at: blk_mq_freeze_queue_nomemsave+0x12/0x20
[   93.784319] [   T1160] 
                          stack backtrace:
[   93.785619] [   T1160] CPU: 1 UID: 0 PID: 1160 Comm: fio Not tainted 7.4.0-rc5 #506 PREEMPT(full) 
[   93.786694] [   T1160] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.17.0-10.fc44 06/10/2025
[   93.787908] [   T1160] Call Trace:
[   93.788314] [   T1160]  <TASK>
[   93.788673] [   T1160]  dump_stack_lvl+0x6a/0x90
[   93.789253] [   T1160]  print_circular_bug.cold+0x189/0x1eb
[   93.789942] [   T1160]  check_noncircular+0x173/0x1a0
[   93.790543] [   T1160]  __lock_acquire+0xe68/0x2490
[   93.791140] [   T1160]  lock_acquire+0x1b1/0x340
[   93.791690] [   T1160]  ? elevator_change+0x197/0x500
[   93.792348] [   T1160]  ? __pfx___might_resched+0x10/0x10
[   93.793013] [   T1160]  ? __pfx___flush_work+0x10/0x10
[   93.793626] [   T1160]  __mutex_lock+0x1a9/0x2550
[   93.794213] [   T1160]  ? elevator_change+0x197/0x500
[   93.794813] [   T1160]  ? elevator_change+0x197/0x500
[   93.795440] [   T1160]  ? __pfx___mutex_lock+0x10/0x10
[   93.796072] [   T1160]  ? enable_work+0x156/0x200
[   93.796630] [   T1160]  ? enable_work+0x156/0x200
[   93.797205] [   T1160]  ? __pfx_enable_work+0x10/0x10
[   93.797806] [   T1160]  ? __pfx___might_resched+0x10/0x10
[   93.798479] [   T1160]  ? cancel_delayed_work_sync+0x85/0xa0
[   93.799167] [   T1160]  ? blk_mq_cancel_work_sync+0x102/0x2c0
[   93.799864] [   T1160]  ? elevator_change+0x197/0x500
[   93.800475] [   T1160]  elevator_change+0x197/0x500
[   93.801083] [   T1160]  elv_iosched_store+0x364/0x410
[   93.801684] [   T1160]  ? __pfx_elv_iosched_store+0x10/0x10
[   93.802358] [   T1160]  ? lock_acquire+0x1b1/0x340
[   93.802941] [   T1160]  ? kernfs_fop_write_iter+0x257/0x5e0
[   93.803600] [   T1160]  ? __pfx___might_resched+0x10/0x10
[   93.804265] [   T1160]  ? __pfx_sysfs_kf_write+0x10/0x10
[   93.804921] [   T1160]  queue_attr_store+0x25f/0x3e0
[   93.805512] [   T1160]  ? __pfx_queue_attr_store+0x10/0x10
[   93.806189] [   T1160]  ? lock_acquire+0x1b1/0x340
[   93.806757] [   T1160]  ? lock_acquire+0x1c1/0x340
[   93.807355] [   T1160]  ? find_held_lock+0x2b/0x80
[   93.807950] [   T1160]  ? sysfs_file_kobj+0xaf/0x1b0
[   93.808539] [   T1160]  ? lock_release+0x1b5/0x340
[   93.809133] [   T1160]  ? sysfs_file_kobj+0xb9/0x1b0
[   93.809740] [   T1160]  ? sysfs_kf_write+0x61/0x160
[   93.810344] [   T1160]  ? __pfx_queue_attr_store+0x10/0x10
[   93.811019] [   T1160]  kernfs_fop_write_iter+0x3d6/0x5e0
[   93.811658] [   T1160]  ? __pfx_kernfs_fop_write_iter+0x10/0x10
[   93.812387] [   T1160]  vfs_write+0x4b3/0xf30
[   93.812937] [   T1160]  ? __pfx_vfs_write+0x10/0x10
[   93.813516] [   T1160]  ? lock_acquire+0x1b1/0x340
[   93.814117] [   T1160]  ? __pfx_folio_remove_rmap_ptes+0x10/0x10
[   93.814963] [   T1160]  ? lock_release+0x1b5/0x340
[   93.815656] [   T1160]  ? find_held_lock+0x2b/0x80
[   93.816247] [   T1160]  ksys_write+0x112/0x250
[   93.816772] [   T1160]  ? __pfx_ksys_write+0x10/0x10
[   93.817390] [   T1160]  ? do_wp_page+0xe4e/0x36d0
[   93.817979] [   T1160]  ? rcu_is_watching+0x12/0xb0
[   93.818559] [   T1160]  do_syscall_64+0xf4/0x6b0
[   93.819120] [   T1160]  ? __pfx_do_wp_page+0x10/0x10
[   93.819709] [   T1160]  ? lock_acquire+0x1b1/0x340
[   93.820294] [   T1160]  ? __pfx_do_raw_spin_lock+0x10/0x10
[   93.820963] [   T1160]  ? __pfx_pte_write+0x10/0x10
[   93.821541] [   T1160]  ? __handle_mm_fault+0x14b3/0x20c0
[   93.822201] [   T1160]  ? __lock_acquire+0x54a/0x2490
[   93.822798] [   T1160]  ? __pfx___css_rstat_updated+0x10/0x10
[   93.823509] [   T1160]  ? lock_acquire+0x1b1/0x340
[   93.824101] [   T1160]  ? rcu_is_watching+0x12/0xb0
[   93.824681] [   T1160]  ? count_memcg_events+0x10f/0x4c0
[   93.825337] [   T1160]  ? find_held_lock+0x2b/0x80
[   93.825922] [   T1160]  ? rcu_read_unlock+0x17/0x60
[   93.826502] [   T1160]  ? lock_release+0x1b5/0x340
[   93.827092] [   T1160]  ? find_held_lock+0x2b/0x80
[   93.827662] [   T1160]  ? exc_page_fault+0x94/0x140
[   93.828265] [   T1160]  ? lock_release+0x1b5/0x340
[   93.828841] [   T1160]  ? rcu_is_watching+0x12/0xb0
[   93.829422] [   T1160]  ? do_syscall_64+0x2d/0x6b0
[   93.830023] [   T1160]  ? trace_hardirqs_off_finish+0x139/0x180
[   93.830747] [   T1160]  ? lockdep_hardirqs_off+0xaf/0xf0
[   93.831388] [   T1160]  ? do_syscall_64+0x60/0x6b0
[   93.831981] [   T1160]  entry_SYSCALL_64_after_hwframe+0x76/0x7e
[   93.832692] [   T1160] RIP: 0033:0x7fc8a2d75e32
[   93.833244] [   T1160] Code: 08 0f 85 91 41 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 <c3> 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 f3 0f 1e fa 55 bf 01 00
[   93.835614] [   T1160] RSP: 002b:00007ffde4e5cdb8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
[   93.836648] [   T1160] RAX: ffffffffffffffda RBX: 0000000030c56430 RCX: 00007fc8a2d75e32
[   93.837630] [   T1160] RDX: 0000000000000004 RSI: 0000000030cb1a90 RDI: 0000000000000007
[   93.838602] [   T1160] RBP: 00007ffde4e5cde0 R08: 0000000000000000 R09: 0000000000000000
[   93.839598] [   T1160] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000004
[   93.840574] [   T1160] R13: 0000000000000004 R14: 0000000030cb1a90 R15: 0000000000000000
[   93.841557] [   T1160]  </TASK>
[  155.641594] [   T1388] block nbd0: NBD_DISCONNECT
[  155.642118] [   T1388] block nbd0: Disconnected due to user request.
[  155.644143] [   T1388] block nbd0: shutting down sockets

  parent reply	other threads:[~2026-12-03  0:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29 23:52 [PATCH blktests v3 0/2] Add an NBD performance test Bart Van Assche
2026-11-29 23:52 ` [PATCH blktests v3 1/2] nbd/rc: Declare the loop variables of the wait helpers local Bart Van Assche
2026-11-29 23:52 ` [PATCH blktests v3 2/2] nbd/006: Measure NBD IOPS with a null_blk backing device Bart Van Assche
2026-12-03  0:23 ` Shin'ichiro Kawasaki [this message]
2026-12-03  0:31   ` [PATCH blktests v3 0/2] Add an NBD performance test Bart Van Assche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=axC0sbhx9y1UCNyw@shinmob \
    --to=shinichiro.kawasaki@wdc.com \
    --cc=bvanassche@acm.org \
    --cc=linux-block@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox