daandemeyer / rpms / systemd

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