Commit b484547f authored by Seth Howell's avatar Seth Howell Committed by Daniel Verkamp
Browse files

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: default avatarSeth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/410954


Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
parent d0b7400c
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -98,11 +98,19 @@ def create_fio_config(size, q_depth, devices, test, run_time, verify):


def set_device_parameter(devices, filename_template, value):
    valid_value = True

    for dev in devices:
        filename = filename_template % dev
        f = open(filename, 'r+b')
        try:
            f.write(value.encode())
            f.close()
        except OSError:
            valid_value = False
            continue

    return valid_value


def configure_devices(devices):
@@ -120,7 +128,8 @@ def configure_devices(devices):
        print("Could not set block device queue depths.")
    else:
        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__":