From: Sagi Grimberg <sagi@grimberg.me>
To: linux-nvme@lists.infradead.org
Cc: Christoph Hellwig <hch@lst.de>, Keith Busch <kbusch@kernel.org>,
Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>,
Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Subject: Re: [PATCH blktests] nvme: add regression test for concurrently enable/disable nvmet ns
Date: Tue, 21 May 2024 13:07:23 +0300 [thread overview]
Message-ID: <ecb4dc5f-df4d-4c49-94ba-3fb8c3818fcd@grimberg.me> (raw)
In-Reply-To: <20240521085623.87681-1-sagi@grimberg.me>
Forgot to CC Shinichiro...
On 21/05/2024 11:56, Sagi Grimberg wrote:
> Reproduce a hang in nvmet when concurrently disabling/enabling
> an nvmet namespace.
>
> Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
> ---
> tests/nvme/051 | 48 ++++++++++++++++++++++++++++++++++++++++++++++
> tests/nvme/051.out | 2 ++
> 2 files changed, 50 insertions(+)
> create mode 100755 tests/nvme/051
> create mode 100644 tests/nvme/051.out
>
> diff --git a/tests/nvme/051 b/tests/nvme/051
> new file mode 100755
> index 000000000000..ddc097310dd7
> --- /dev/null
> +++ b/tests/nvme/051
> @@ -0,0 +1,48 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-3.0+
> +# Copyright (C) 2024 Sagi Grimberg
> +#
> +# Regression test for kernel hang when enabling/disabling nvmet
> +# namespace concurrently
> +
> +. tests/nvme/rc
> +
> +DESCRIPTION="test nvmet concurrent ns enable/disable"
> +QUICK=1
> +
> +requires() {
> + _nvme_requires
> + _require_nvme_trtype_is_fabrics
> +}
> +
> +set_conditions() {
> + _set_nvme_trtype "$@"
> +}
> +
> +ns_enable_disable_loop() {
> + local ns="$1"
> + local iterations=200
> + for ((i = 1; i <= ${iterations}; i++)); do
> + echo 0 > $ns/enable
> + echo 1 > $ns/enable
> + done
> +}
> +
> +test() {
> + echo "Running ${TEST_NAME}"
> +
> + _setup_nvmet
> +
> + _nvmet_target_setup
> + ns="${NVMET_CFS}subsystems/${def_subsysnqn}/namespaces/1"
> +
> + # fire off two enable/disable loops concurrently and wait
> + # for them to complete...
> + ns_enable_disable_loop $ns &
> + ns_enable_disable_loop $ns &
> + wait
> +
> + _nvmet_target_cleanup
> +
> + echo "Test complete"
> +}
> diff --git a/tests/nvme/051.out b/tests/nvme/051.out
> new file mode 100644
> index 000000000000..156f0687aab2
> --- /dev/null
> +++ b/tests/nvme/051.out
> @@ -0,0 +1,2 @@
> +Running nvme/051
> +Test complete
next prev parent reply other threads:[~2024-05-21 10:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-21 8:56 [PATCH blktests] nvme: add regression test for concurrently enable/disable nvmet ns Sagi Grimberg
2024-05-21 8:56 ` [PATCH] nvmet: fix ns enable/disable possible hang Sagi Grimberg
2024-05-21 19:39 ` Christoph Hellwig
2024-05-22 0:45 ` Chaitanya Kulkarni
2024-05-21 10:07 ` Sagi Grimberg [this message]
2024-05-22 3:46 ` [PATCH blktests] nvme: add regression test for concurrently enable/disable nvmet ns Yi Zhang
2024-05-22 0:54 ` Chaitanya Kulkarni
2024-05-22 8:58 ` Sagi Grimberg
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=ecb4dc5f-df4d-4c49-94ba-3fb8c3818fcd@grimberg.me \
--to=sagi@grimberg.me \
--cc=Chaitanya.Kulkarni@wdc.com \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=shinichiro.kawasaki@wdc.com \
/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