Skip to content

Commit

Permalink
Add new testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
SRIKKANTH committed Sep 3, 2024
1 parent 02b34fc commit b0f1fe2
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 3 deletions.
7 changes: 5 additions & 2 deletions microsoft/testsuites/performance/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def perf_disk(
fio_result_list: List[FIOResult] = []
fio = node.tools[Fio]
numjobiterator = 0
# In fio test, numjob*max_iodepth (aio-nr) should always be less than aio-max-nr.
# In fio test with ioengine == 'libaio',
# numjob*max_iodepth (aio-nr) should always be less than aio-max-nr.
# The default value of aio-max-nr is 65536.
# As max_iodepth is 256, numjob which is equal to 'nproc' should not exceed 256.
# /proc/sys/fs/aio-nr is the number of events currently active.
Expand All @@ -85,7 +86,9 @@ def perf_disk(
# fail with EAGAIN.
# read: https://www.kernel.org/doc/Documentation/sysctl/fs.txt
# So we set numjob to 256 if numjob is larger than 256.
numjob = min(numjob, 256)
# This limitation is only needed for 'libaio' ioengine but not for 'io_uring'.
if ioengine == "libaio":
numjob = min(numjob, 256)
for mode in FIOMODES:
iodepth = start_iodepth
numjobindex = 0
Expand Down
37 changes: 37 additions & 0 deletions microsoft/testsuites/performance/nvmeperf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,43 @@ 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,
)

def perf_nvme_io_uring(self, node: Node, result: TestResult) -> None:
nvme = node.features[Nvme]
nvme_namespaces = nvme.get_raw_nvme_disks()
disk_count = len(nvme_namespaces)
Expand Down
1 change: 0 additions & 1 deletion microsoft/testsuites/performance/storageperf.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,6 @@ def _perf_premium_datadisks(
size_mb=8192,
overwrite=True,
test_result=test_result,
ioengine="io_uring",
)

def after_case(self, log: Logger, **kwargs: Any) -> None:
Expand Down

0 comments on commit b0f1fe2

Please sign in to comment.