Skip to content

Commit

Permalink
fix: change bfq patch to select "none" scheduler as default (#10240)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
christopherco authored Aug 24, 2024
1 parent 3c01c0a commit bde321f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
5 changes: 4 additions & 1 deletion SPECS-SIGNED/systemd-boot-signed/systemd-boot-signed.spec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Version: 255
# determine the build information from local checkout
Version: %(tools/meson-vcs-tag.sh . error | sed -r 's/-([0-9])/.^\1/; s/-g/_g/')
%endif
Release: 16%{?dist}
Release: 17%{?dist}
License: LGPL-2.1-or-later AND MIT AND GPL-2.0-or-later
Vendor: Microsoft Corporation
Distribution: Azure Linux
Expand Down Expand Up @@ -86,6 +86,9 @@ popd
/usr/share/man/man7/systemd-boot.7.gz

%changelog
* Fri Aug 23 2024 Chris Co <[email protected]> - 255-17
- Bump release to match systemd spec

* Wed Jul 10 2024 Thien Trung Vuong <[email protected]> - 255-16
- Bump release to match systemd spec

Expand Down
16 changes: 13 additions & 3 deletions SPECS/systemd/systemd.spec
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Version: 255
# determine the build information from local checkout
Version: %(tools/meson-vcs-tag.sh . error | sed -r 's/-([0-9])/.^\1/; s/-g/_g/')
%endif
Release: 16%{?dist}
Release: 17%{?dist}

# FIXME - hardcode to 'stable' for now as that's what we have in our blobstore
%global stable 1
Expand Down Expand Up @@ -122,10 +122,17 @@ GIT_DIR=../../src/systemd/.git git diffab -M v233..master@{2017-06-15} -- hwdb/[
# Drop when dracut-060 is available.
Patch0001: https://github.com/systemd/systemd/pull/26494.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
%if 0%{?azl}
# 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".
Patch0490: use-none-scheduler.patch
%endif

# Adjust upstream config to use our shared stack
# NOTE: the patch was based on the fedora patch, but renamed to
Expand Down Expand Up @@ -1202,6 +1209,9 @@ rm -f %{name}.lang
# %autochangelog. So we need to continue manually maintaining the
# changelog here.
%changelog
* Fri Aug 23 2024 Chris Co <[email protected]> - 255-17
- Change bfq scheduler patch to select "none" i/o scheduler

* Wed Jul 10 2024 Thien Trung Vuong <[email protected]> - 255-16
- Update tag to build systemd-boot exclusively on x86_64

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <[email protected]>
Date: Wed, 14 Aug 2019 15:57:42 +0200
Subject: [PATCH] udev: use bfq as the default scheduler

NOTE change for azurelinux:

This patch from Fedora has been renamed from "bfq" to "none" and adjusted
to set the udev rule's i/o scheduler from "bfq" to "none" which is the
preferred default i/o scheduler in Azure VMs and for NVMe drives.

Original Fedora commit message below:

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
Expand All @@ -25,7 +33,7 @@ index 0000000000..850b64540e
+
+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"
+ ATTR{queue/scheduler}="none"
diff --git a/rules.d/meson.build b/rules.d/meson.build
index 20fca222da..94fee9d7c0 100644
--- a/rules.d/meson.build
Expand Down

0 comments on commit bde321f

Please sign in to comment.