Skip to content

Commit bde321f

Browse files
fix: change bfq patch to select "none" scheduler as default (#10240)
On Azure, it is recommended to use an i/o scheduler that passes the scheduling decisions to the underlying Hyper-V hypervisor. In our case, we should use the "none" scheduler, which is also ideal for fast random I/O devices like NVMe. So we update Fedora's bfq patch to change the udev rule to select "none" instead of Fedora's default Budget Fair Queuing (bfq) and rename the patch from referencing "bfq" to "none". https://learn.microsoft.com/en-us/windows-server/virtualization/hyper-v/best-practices-for-running-linux-on-hyper-v#use-io-scheduler-noopnone-for-better-disk-io-performance Signed-off-by: Chris Co <chrco@microsoft.com>
1 parent 3c01c0a commit bde321f

3 files changed

Lines changed: 26 additions & 5 deletions

File tree

SPECS-SIGNED/systemd-boot-signed/systemd-boot-signed.spec

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Version: 255
1414
# determine the build information from local checkout
1515
Version: %(tools/meson-vcs-tag.sh . error | sed -r 's/-([0-9])/.^\1/; s/-g/_g/')
1616
%endif
17-
Release: 16%{?dist}
17+
Release: 17%{?dist}
1818
License: LGPL-2.1-or-later AND MIT AND GPL-2.0-or-later
1919
Vendor: Microsoft Corporation
2020
Distribution: Azure Linux
@@ -86,6 +86,9 @@ popd
8686
/usr/share/man/man7/systemd-boot.7.gz
8787

8888
%changelog
89+
* Fri Aug 23 2024 Chris Co <chrco@microsoft.com> - 255-17
90+
- Bump release to match systemd spec
91+
8992
* Wed Jul 10 2024 Thien Trung Vuong <tvuong@microsoft.com> - 255-16
9093
- Bump release to match systemd spec
9194

SPECS/systemd/systemd.spec

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Version: 255
5050
# determine the build information from local checkout
5151
Version: %(tools/meson-vcs-tag.sh . error | sed -r 's/-([0-9])/.^\1/; s/-g/_g/')
5252
%endif
53-
Release: 16%{?dist}
53+
Release: 17%{?dist}
5454

5555
# FIXME - hardcode to 'stable' for now as that's what we have in our blobstore
5656
%global stable 1
@@ -122,10 +122,17 @@ GIT_DIR=../../src/systemd/.git git diffab -M v233..master@{2017-06-15} -- hwdb/[
122122
# Drop when dracut-060 is available.
123123
Patch0001: https://github.com/systemd/systemd/pull/26494.patch
124124

125-
126125
# Those are downstream-only patches, but we don't want them in packit builds:
127126
# https://bugzilla.redhat.com/show_bug.cgi?id=1738828
128-
Patch0490: use-bfq-scheduler.patch
127+
%if 0%{?azl}
128+
# On Azure, it is recommended to use an i/o scheduler that passes the scheduling
129+
# decisions to the underlying Hyper-V hypervisor. In our case, we should use
130+
# the "none" scheduler, which is also ideal for fast random I/O devices like
131+
# NVMe. So we update Fedora's bfq patch to change the udev rule to select "none"
132+
# instead of Fedora's default Budget Fair Queuing (bfq) and rename the patch
133+
# from referencing "bfq" to "none".
134+
Patch0490: use-none-scheduler.patch
135+
%endif
129136

130137
# Adjust upstream config to use our shared stack
131138
# NOTE: the patch was based on the fedora patch, but renamed to
@@ -1202,6 +1209,9 @@ rm -f %{name}.lang
12021209
# %autochangelog. So we need to continue manually maintaining the
12031210
# changelog here.
12041211
%changelog
1212+
* Fri Aug 23 2024 Chris Co <chrco@microsoft.com> - 255-17
1213+
- Change bfq scheduler patch to select "none" i/o scheduler
1214+
12051215
* Wed Jul 10 2024 Thien Trung Vuong <tvuong@microsoft.com> - 255-16
12061216
- Update tag to build systemd-boot exclusively on x86_64
12071217

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
33
Date: Wed, 14 Aug 2019 15:57:42 +0200
44
Subject: [PATCH] udev: use bfq as the default scheduler
55

6+
NOTE change for azurelinux:
7+
8+
This patch from Fedora has been renamed from "bfq" to "none" and adjusted
9+
to set the udev rule's i/o scheduler from "bfq" to "none" which is the
10+
preferred default i/o scheduler in Azure VMs and for NVMe drives.
11+
12+
Original Fedora commit message below:
13+
614
As requested in https://bugzilla.redhat.com/show_bug.cgi?id=1738828.
715
Test results are that bfq seems to behave better and more consistently on
816
typical hardware. The kernel does not have a configuration option to set
@@ -25,7 +33,7 @@ index 0000000000..850b64540e
2533
+
2634
+ACTION=="add", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", \
2735
+ KERNEL=="mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|sd*[!0-9]|sr*", \
28-
+ ATTR{queue/scheduler}="bfq"
36+
+ ATTR{queue/scheduler}="none"
2937
diff --git a/rules.d/meson.build b/rules.d/meson.build
3038
index 20fca222da..94fee9d7c0 100644
3139
--- a/rules.d/meson.build

0 commit comments

Comments
 (0)