ff6046
From 1255584bb0a595fb555af7e14230ab1b7aa6adcd Mon Sep 17 00:00:00 2001
ff6046
From: Lukas Nykryn <lnykryn@redhat.com>
ff6046
Date: Tue, 12 Feb 2019 16:58:16 +0100
ff6046
Subject: [PATCH] rules: add elevator= kernel command line parameter
ff6046
ff6046
Kernel removed the elevator= option, so let's reintroduce
ff6046
it for rhel8 via udev rule.
ff6046
ff6046
rhel-only
ff6046
Resolves: #1670126
ff6046
---
ff6046
 rules/40-elevator.rules | 20 ++++++++++++++++++++
ff6046
 1 file changed, 20 insertions(+)
ff6046
 create mode 100644 rules/40-elevator.rules
ff6046
ff6046
diff --git a/rules/40-elevator.rules b/rules/40-elevator.rules
ff6046
new file mode 100644
ff6046
index 0000000000..dbe8fc81a4
ff6046
--- /dev/null
ff6046
+++ b/rules/40-elevator.rules
ff6046
@@ -0,0 +1,20 @@
ff6046
+# We aren't adding devices skip the elevator check
ff6046
+ACTION!="add", GOTO="sched_out"
ff6046
+
ff6046
+SUBSYSTEM!="block", GOTO="sched_out"
ff6046
+ENV{DEVTYPE}!="disk", GOTO="sched_out"
ff6046
+
ff6046
+# Technically, dm-multipath can be configured to use an I/O scheduler.
ff6046
+# However, there are races between the 'add' uevent and the linking in
ff6046
+# of the queue/scheduler sysfs file.  For now, just skip dm- devices.
ff6046
+KERNEL=="dm-*|md*", GOTO="sched_out"
ff6046
+
ff6046
+# Skip bio-based devices, which don't support an I/O scheduler.
ff6046
+ATTR{queue/scheduler}=="none", GOTO="sched_out"
ff6046
+
ff6046
+# If elevator= is specified on the kernel command line, change the
ff6046
+# scheduler to the one specified.
ff6046
+IMPORT{cmdline}="elevator"
ff6046
+ENV{elevator}!="", ATTR{queue/scheduler}="$env{elevator}"
ff6046
+
ff6046
+LABEL="sched_out"
ff6046
\ No newline at end of file