dcavalca / rpms / systemd

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