Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Guixin Liu <kanie@linux.alibaba.com>
To: Chaitanya Kulkarni <chaitanyak@nvidia.com>
Cc: "linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
	"hch@lst.de" <hch@lst.de>, "sagi@grimberg.me" <sagi@grimberg.me>
Subject: Re: [PATCH] nvmet: make nvmet_wq visible in sysfs
Date: Thu, 31 Oct 2024 14:55:31 +0800	[thread overview]
Message-ID: <ecf925c2-cbdf-4f09-8842-f8d4ab1137a1@linux.alibaba.com> (raw)
In-Reply-To: <613fd580-6faa-4b1f-96e9-ce306da27fdc@nvidia.com>


在 2024/10/31 14:39, Chaitanya Kulkarni 写道:
> On 10/30/24 19:45, Chaitanya Kulkarni wrote:
>>> I will send the v2 with our usecase to expain why we should restrict the cpumask,
>>>
>>> I'm concerned whether blktests can handle such complex tests, as it relies on deploying
>>>
>>> many Docker containers and services. Should it only test the case of setting the cpumask
>>>
>>> with fio?
>>>
>>> Best Regards,
>>>
>>> Guixin Liu
>>>
>> For now just cpumask and fio is sufficient so that when we upstream this patch we have some sort of testing done via sysfs.
>>
>>
>> -ck
> based on my very limited understanding I've written a rough blktest
> for your patch see if this helps, it's bit rough and totally
> untested  :-
>
> #!/bin/bash
> # SPDX-License-Identifier: GPL-3.0+
> # Description: Test `nvmet_wq` cpumask sysfs attribute with NVMe-oF and
> fio workload
>
> . tests/nvme/rc
>
> DESCRIPTION="Test nvmet_wq cpumask sysfs attribute and verify with fio
> on NVMe-oF device"
>
> requires() {
>       _nvme_requires
>       _have_fio
>       _require_nvme_trtype_is_fabrics
> }
>
> test() {
>       local cpumask_path="/sys/devices/virtual/workqueue/nvmet_wq/cpumask"
>
>       # Check if cpumask attribute exists
>       if [[ ! -f "$cpumask_path" ]]; then
>           SKIP_REASONS+=("nvmet_wq cpumask sysfs attribute not found.")
>           return 1
>       fi
>
>       # Save original cpumask value
>       local original_cpumask
>       original_cpumask=$(cat "$cpumask_path")
>       echo "Original cpumask: $original_cpumask"
>
>       # Set a new cpumask (e.g., CPU 0)
>       echo 1 | tee "$cpumask_path" > /dev/null
>       local new_cpumask
>       new_cpumask=$(cat "$cpumask_path")
>
>       if [[ "$new_cpumask" != "1" ]]; then
>           echo "Test Failed: cpumask was not set correctly"
>           return 1
>       else
>           echo "Test Passed: cpumask set to $new_cpumask"
>       fi
>
>       # Set up NVMe-over-Fabrics target
>       echo "Setting up NVMe-oF target"
>       _setup_nvmet
>       _nvmet_target_setup
>       _nvme_connect_subsys
>
>       # Locate the NVMe-oF namespace
>       local ns
>       ns=$(_find_nvme_ns "${def_subsys_uuid}")
>
>       # Run fio with data verification on NVMe-oF device
>       echo "Starting fio workload with verification on NVMe-oF device"
>       fio --name=nvmet_wq_test --filename="/dev/$ns" --direct=1
> --rw=randwrite \
>           --bs=4k --size=100M --numjobs=1 --verify=crc32c --verify_fatal=1 \
>           --time_based --runtime=30s --iodepth=16 --ioengine=libaio
> --group_reporting
>
>       # Disconnect and clean up NVMe-oF target
>       echo "Cleaning up NVMe-oF setup"
>       _nvme_disconnect_subsys
>       _nvmet_target_cleanup
>
>       # Restore original cpumask
>       echo "$original_cpumask" | tee "$cpumask_path" > /dev/null
>       restored_cpumask=$(cat "$cpumask_path")
>
>       if [[ "$restored_cpumask" != "$original_cpumask" ]]; then
>           echo "Failed to restore original cpumask."
>           return 1
>       else
>           echo "Original cpumask restored successfully."
>       fi
> }

The script looks good, thank you for adding the new test to my patch.

Best Regards,

Guixin Liu



      reply	other threads:[~2024-10-31  6:55 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-29  1:49 [PATCH] nvmet: make nvmet_wq visible in sysfs Guixin Liu
2024-10-29  5:04 ` Chaitanya Kulkarni
2024-10-29  6:46   ` Guixin Liu
2024-10-29 19:52     ` Chaitanya Kulkarni
2024-10-30  0:49       ` Chaitanya Kulkarni
2024-10-30  1:44       ` Guixin Liu
2024-10-30  5:53         ` hch
2024-10-30  6:44           ` Guixin Liu
2024-10-30  6:33         ` Chaitanya Kulkarni
2024-10-30 11:20           ` Guixin Liu
2024-10-30 18:38             ` Chaitanya Kulkarni
2024-10-31  2:01               ` Guixin Liu
2024-10-31  2:45                 ` Chaitanya Kulkarni
2024-10-31  6:39                   ` Chaitanya Kulkarni
2024-10-31  6:55                     ` Guixin Liu [this message]

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=ecf925c2-cbdf-4f09-8842-f8d4ab1137a1@linux.alibaba.com \
    --to=kanie@linux.alibaba.com \
    --cc=chaitanyak@nvidia.com \
    --cc=hch@lst.de \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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