Skip to content

Commit

Permalink
Update nvmeperf.py
Browse files Browse the repository at this point in the history
  • Loading branch information
SRIKKANTH committed Sep 14, 2024
1 parent 2747a2b commit 71564e3
Showing 1 changed file with 5 additions and 36 deletions.
41 changes: 5 additions & 36 deletions microsoft/testsuites/performance/nvmeperf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,41 +38,7 @@ class NvmePerformace(TestSuite):
),
)
def perf_nvme(self, node: Node, result: TestResult) -> None:
nvme = node.features[Nvme]
nvme_namespaces = nvme.get_raw_nvme_disks()
disk_count = len(nvme_namespaces)
assert_that(disk_count).described_as(
"At least 1 NVMe disk for fio testing."
).is_greater_than(0)
filename = ":".join(nvme_namespaces)
echo = node.tools[Echo]
# This will have kernel avoid sending IPI to finish I/O on the issuing CPUs
# if they are not on the same NUMA node of completion CPU.
# This setting will give a better and more stable IOPS.
for nvme_namespace in nvme_namespaces:
# /dev/nvme0n1 => nvme0n1
disk_name = nvme_namespace.split("/")[-1]
echo.write_to_file(
"0",
node.get_pure_path(f"/sys/block/{disk_name}/queue/rq_affinity"),
sudo=True,
)
cpu = node.tools[Lscpu]
core_count = cpu.get_core_count()
start_iodepth = 1
max_iodepth = 256
perf_disk(
node,
start_iodepth,
max_iodepth,
filename,
core_count=core_count,
disk_count=disk_count,
numjob=core_count,
disk_setup_type=DiskSetupType.raw,
disk_type=DiskType.nvme,
test_result=result,
)
self._perf_nvme(node, IoEngine.LIBAIO, result)

@TestCaseMetadata(
description="""
Expand All @@ -86,6 +52,9 @@ def perf_nvme(self, node: Node, result: TestResult) -> None:
),
)
def perf_nvme_io_uring(self, node: Node, result: TestResult) -> None:
self._perf_nvme(node, IoEngine.IO_URING, result)

def _perf_nvme(self, node: Node, ioengine: IoEngine, result: TestResult) -> None:
nvme = node.features[Nvme]
nvme_namespaces = nvme.get_raw_nvme_disks()
disk_count = len(nvme_namespaces)
Expand Down Expand Up @@ -120,5 +89,5 @@ def perf_nvme_io_uring(self, node: Node, result: TestResult) -> None:
disk_setup_type=DiskSetupType.raw,
disk_type=DiskType.nvme,
test_result=result,
ioengine=IoEngine.IO_URING,
ioengine=ioengine,
)

0 comments on commit 71564e3

Please sign in to comment.