scripts: amend scheduler option in fio.py
The 4.16 Linux Kernel does not appear to have a noop scheduler for block devices. Instead, it supplies a none option to turn off the scheduler entirely. Change-Id: I2dfb75b845cfff2ce2cabcfd86183b01432ad898 Signed-off-by: Seth Howell <seth.howell@intel.com> Reviewed-on: https://review.gerrithub.io/410954 Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
parent
d0b7400c08
commit
b484547f57
@ -98,11 +98,19 @@ def create_fio_config(size, q_depth, devices, test, run_time, verify):
|
|||||||
|
|
||||||
|
|
||||||
def set_device_parameter(devices, filename_template, value):
|
def set_device_parameter(devices, filename_template, value):
|
||||||
|
valid_value = True
|
||||||
|
|
||||||
for dev in devices:
|
for dev in devices:
|
||||||
filename = filename_template % dev
|
filename = filename_template % dev
|
||||||
f = open(filename, 'r+b')
|
f = open(filename, 'r+b')
|
||||||
f.write(value.encode())
|
try:
|
||||||
f.close()
|
f.write(value.encode())
|
||||||
|
f.close()
|
||||||
|
except OSError:
|
||||||
|
valid_value = False
|
||||||
|
continue
|
||||||
|
|
||||||
|
return valid_value
|
||||||
|
|
||||||
|
|
||||||
def configure_devices(devices):
|
def configure_devices(devices):
|
||||||
@ -120,7 +128,8 @@ def configure_devices(devices):
|
|||||||
print("Could not set block device queue depths.")
|
print("Could not set block device queue depths.")
|
||||||
else:
|
else:
|
||||||
print("Requested queue_depth {} but only {} is supported.".format(str(requested_qd), str(qd)))
|
print("Requested queue_depth {} but only {} is supported.".format(str(requested_qd), str(qd)))
|
||||||
set_device_parameter(devices, "/sys/block/%s/queue/scheduler", "noop")
|
if not set_device_parameter(devices, "/sys/block/%s/queue/scheduler", "noop"):
|
||||||
|
set_device_parameter(devices, "/sys/block/%s/queue/scheduler", "none")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
Loading…
Reference in New Issue
Block a user