diff --git a/60-block-scheduler.rules b/60-block-scheduler.rules new file mode 100644 index 0000000..850b645 --- /dev/null +++ b/60-block-scheduler.rules @@ -0,0 +1,5 @@ +# do not edit this file, it will be overwritten on update + +ACTION=="add", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", \ + KERNEL=="mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|sd*[!0-9]|sr*", \ + ATTR{queue/scheduler}="bfq" diff --git a/systemd.spec b/systemd.spec index 8547d82..4d80273 100644 --- a/systemd.spec +++ b/systemd.spec @@ -87,6 +87,7 @@ Source14: 10-oomd-defaults.conf Source15: 10-oomd-per-slice-defaults.conf Source16: 10-timeout-abort.conf Source17: 10-map-count.conf +Source18: 60-block-scheduler.rules Source21: macros.sysusers Source22: sysusers.attr @@ -123,8 +124,6 @@ Patch0021: 0002-meson-build-libsystemd-core-via-an-intermediate-stat.patch Patch0022: 0003-meson-add-option-to-build-systemd-executor-staticall.patch # Those are downstream-only patches, but we don't want them in packit builds: -# https://bugzilla.redhat.com/show_bug.cgi?id=1738828 -Patch0490: use-bfq-scheduler.patch # https://bugzilla.redhat.com/show_bug.cgi?id=2251843 Patch0491: https://github.com/systemd/systemd/pull/30846.patch @@ -970,6 +969,12 @@ install -Dm0644 10-timeout-abort.conf.user %{buildroot}%{user_unit_dir}/service. # https://fedoraproject.org/wiki/Changes/IncreaseVmMaxMapCount install -Dm0644 -t %{buildroot}%{_prefix}/lib/sysctl.d/ %{SOURCE17} +# As requested in https://bugzilla.redhat.com/show_bug.cgi?id=1738828. +# Test results are that bfq seems to behave better and more consistently on +# typical hardware. The kernel does not have a configuration option to set the +# default scheduler, and it currently needs to be set by userspace. +install -Dm0644 -t %{buildroot}%{_prefix}/lib/udev/rules.d/ %{SOURCE18} + sed -i 's|#!/usr/bin/env python3|#!%{__python3}|' %{buildroot}/usr/lib/systemd/tests/run-unit-tests.py install -m 0644 -D -t %{buildroot}%{_rpmconfigdir}/macros.d/ %{SOURCE21} diff --git a/use-bfq-scheduler.patch b/use-bfq-scheduler.patch deleted file mode 100644 index 6ad5e5d..0000000 --- a/use-bfq-scheduler.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 1990fb757f6d275d807fcb48ad09f5fc7c947bc6 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= -Date: Wed, 14 Aug 2019 15:57:42 +0200 -Subject: [PATCH] udev: use bfq as the default scheduler - -As requested in https://bugzilla.redhat.com/show_bug.cgi?id=1738828. -Test results are that bfq seems to behave better and more consistently on -typical hardware. The kernel does not have a configuration option to set -the default scheduler, and it currently needs to be set by userspace. - -See the bug for more discussion and links. ---- - rules.d/60-block-scheduler.rules | 5 +++++ - rules.d/meson.build | 1 + - 2 files changed, 6 insertions(+) - create mode 100644 rules.d/60-block-scheduler.rules - -diff --git a/rules.d/60-block-scheduler.rules b/rules.d/60-block-scheduler.rules -new file mode 100644 -index 0000000000..850b64540e ---- /dev/null -+++ b/rules.d/60-block-scheduler.rules -@@ -0,0 +1,5 @@ -+# do not edit this file, it will be overwritten on update -+ -+ACTION=="add", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", \ -+ KERNEL=="mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|sd*[!0-9]|sr*", \ -+ ATTR{queue/scheduler}="bfq" -diff --git a/rules.d/meson.build b/rules.d/meson.build -index 20fca222da..94fee9d7c0 100644 ---- a/rules.d/meson.build -+++ b/rules.d/meson.build -@@ -7,6 +7,7 @@ install_data( - rules = [ - [files('60-autosuspend.rules', - '60-block.rules', -+ '60-block-scheduler.rules', - '60-cdrom_id.rules', - '60-dmi-id.rules', - '60-drm.rules', --- -2.41.0 -