All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs-progs: add udev rule to use mq-deadline on zoned btrfs
@ 2022-01-25 13:22 Johannes Thumshirn
  2022-01-25 14:20 ` David Sterba
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Thumshirn @ 2022-01-25 13:22 UTC (permalink / raw)
  To: David Sterba
  Cc: Damien Le Moal, Naohiro Aota, linux-btrfs, Josef Bacik,
	Johannes Thumshirn

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 <johannes.thumshirn@wdc.com>
---
 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 000000000000..d70e22740557
--- /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 a75d9ad8de1c..1223ba6d069f 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)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-25 14:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-25 13:22 [PATCH] btrfs-progs: add udev rule to use mq-deadline on zoned btrfs Johannes Thumshirn
2022-01-25 14:20 ` David Sterba
2022-01-25 14:28   ` Johannes Thumshirn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.