From 1aa806a66c77451950d6d3cd14d86be85c5d09b2 Mon Sep 17 00:00:00 2001 From: Johannes Thumshirn Date: Tue, 25 Jan 2022 05:22:00 -0800 Subject: [PATCH] btrfs-progs: add udev rule to use mq-deadline on zoned btrfs As zoned btrfs uses regular writes for metadata, it needs zone write locking in the IO scheduler. Add a udev rule that configures an IO scheduler doing zone write locking. Signed-off-by: Johannes Thumshirn Signed-off-by: David Sterba --- 64-btrfs-zoned.rules | 9 +++++++++ Makefile | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 64-btrfs-zoned.rules diff --git a/64-btrfs-zoned.rules b/64-btrfs-zoned.rules new file mode 100644 index 00000000..d70e2274 --- /dev/null +++ b/64-btrfs-zoned.rules @@ -0,0 +1,9 @@ +SUBSYSTEM!="block", GOTO="btrfs_end" +ACTION!="add|change", GOTO="btrfs_end" +ENV{ID_FS_TYPE}!="btrfs", GOTO="btrfs_end" + +# Zoned btrfs needs an IO scheduler that supports zone write locking and +# currently mq-deadline is the only scheduler capable of this. +ATTR{queue/zoned}=="host-managed", ATTR{queue/scheduler}="mq-deadline" + +LABEL="btrfs_end" diff --git a/Makefile b/Makefile index a75d9ad8..1223ba6d 100644 --- a/Makefile +++ b/Makefile @@ -231,7 +231,7 @@ image_objects = image/main.o image/sanitize.o all_objects = $(objects) $(cmds_objects) $(libbtrfs_objects) $(convert_objects) \ $(mkfs_objects) $(image_objects) $(libbtrfsutil_objects) -udev_rules = 64-btrfs-dm.rules +udev_rules = 64-btrfs-dm.rules 64-btrfs-zoned.rules ifeq ("$(origin V)", "command line") BUILD_VERBOSE = $(V)