Skip to content

Commit

Permalink
Merge branch 'master' of ssh://git.kernel.dk/data/git/fio
Browse files Browse the repository at this point in the history
* 'master' of ssh://git.kernel.dk/data/git/fio:
  testing: add test for slat + clat = tlat
  engines/null: add FIO_ASYNCIO_SETS_ISSUE_TIME flag
  testing: add test for slat + clat = tlat
  • Loading branch information
axboe committed Aug 9, 2022
2 parents 13ceeb0 + de31fe9 commit 6018d6d
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 0 deletions.
2 changes: 2 additions & 0 deletions engines/null.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,11 @@ static struct null_data *null_init(struct thread_data *td)
if (td->o.iodepth != 1) {
nd->io_us = (struct io_u **) malloc(td->o.iodepth * sizeof(struct io_u *));
memset(nd->io_us, 0, td->o.iodepth * sizeof(struct io_u *));
td->io_ops->flags |= FIO_ASYNCIO_SETS_ISSUE_TIME;
} else
td->io_ops->flags |= FIO_SYNCIO;

td_set_ioengine_flags(td);
return nd;
}

Expand Down
7 changes: 7 additions & 0 deletions t/jobs/t0015-e78980ff.fio
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Expected result: mean(slat) + mean(clat) = mean(lat)
# Buggy result: equality does not hold

[test]
ioengine=libaio
size=1M
iodepth=16
7 changes: 7 additions & 0 deletions t/jobs/t0016-259ebc00.fio
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Expected result: mean(slat) + mean(clat) = mean(lat)
# Buggy result: equality does not hold

[test]
ioengine=null
size=1M
iodepth=16
41 changes: 41 additions & 0 deletions t/run-fio-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,27 @@ def check_result(self):
return


class FioJobTest_t0015(FioJobTest):
"""Test consists of fio test jobs t0015 and t0016
Confirm that mean(slat) + mean(clat) = mean(tlat)"""

def check_result(self):
super(FioJobTest_t0015, self).check_result()

if not self.passed:
return

slat = self.json_data['jobs'][0]['read']['slat_ns']['mean']
clat = self.json_data['jobs'][0]['read']['clat_ns']['mean']
tlat = self.json_data['jobs'][0]['read']['lat_ns']['mean']
logging.debug('Test %d: slat %f, clat %f, tlat %f', self.testnum, slat, clat, tlat)

if abs(slat + clat - tlat) > 1:
self.failure_reason = "{0} slat {1} + clat {2} = {3} != tlat {4},".format(
self.failure_reason, slat, clat, slat+clat, tlat)
self.passed = False


class FioJobTest_iops_rate(FioJobTest):
"""Test consists of fio test job t0009
Confirm that job0 iops == 1000
Expand Down Expand Up @@ -816,6 +837,26 @@ def cpucount4(cls):
'output_format': 'json',
'requirements': [],
},
{
'test_id': 15,
'test_class': FioJobTest_t0015,
'job': 't0015-e78980ff.fio',
'success': SUCCESS_DEFAULT,
'pre_job': None,
'pre_success': None,
'output_format': 'json',
'requirements': [Requirements.linux, Requirements.libaio],
},
{
'test_id': 16,
'test_class': FioJobTest_t0015,
'job': 't0016-259ebc00.fio',
'success': SUCCESS_DEFAULT,
'pre_job': None,
'pre_success': None,
'output_format': 'json',
'requirements': [],
},
{
'test_id': 1000,
'test_class': FioExeTest,
Expand Down

0 comments on commit 6018d6d

Please sign in to comment.