218 lines
6.9 KiB
Diff
Raw Normal View History

2016-12-21 19:30:02 -05:00
From cf6a272bc79c0dae4cd3f6e9771c3ed2b8b18260 Mon Sep 17 00:00:00 2001
From: Tad <tad@spotco.us>
Date: Tue, 26 May 2015 13:15:24 -0400
Subject: [PATCH] More I/O Schedulers
---
arch/arm/configs/cyanogenmod_bacon_defconfig | 14 ++--
block/Kconfig.iosched | 98 ++++++++++++++++++++++++++++
block/Makefile | 7 ++
include/linux/cgroup_subsys.h | 6 ++
include/linux/elevator.h | 2 +
5 files changed, 122 insertions(+), 5 deletions(-)
diff --git a/arch/arm/configs/cyanogenmod_bacon_defconfig b/arch/arm/configs/cyanogenmod_bacon_defconfig
index 87ef3ef..f8a4df2 100644
--- a/arch/arm/configs/cyanogenmod_bacon_defconfig
+++ b/arch/arm/configs/cyanogenmod_bacon_defconfig
@@ -223,11 +223,15 @@ CONFIG_IOSCHED_TEST=y
CONFIG_IOSCHED_DEADLINE=y
CONFIG_IOSCHED_ROW=y
CONFIG_IOSCHED_CFQ=y
-# CONFIG_DEFAULT_DEADLINE is not set
-# CONFIG_DEFAULT_ROW is not set
-# CONFIG_DEFAULT_CFQ is not set
-CONFIG_DEFAULT_NOOP=y
-CONFIG_DEFAULT_IOSCHED="noop"
+CONFIG_IOSCHED_FIOPS=y
+CONFIG_IOSCHED_SIO=y
+CONFIG_IOSCHED_SIOPLUS=y
+CONFIG_IOSCHED_BFQ=y
+CONFIG_IOSCHED_ZEN=y
+CONFIG_IOSCHED_VR=y
+CONFIG_IOSCHED_TRIPNDROID=y
+CONFIG_DEFAULT_SIOPLUS=y
+CONFIG_DEFAULT_IOSCHED="SIOPLUS"
# CONFIG_INLINE_SPIN_TRYLOCK is not set
# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
# CONFIG_INLINE_SPIN_LOCK is not set
diff --git a/block/Kconfig.iosched b/block/Kconfig.iosched
index 5fd98ea..20ab48f 100644
--- a/block/Kconfig.iosched
+++ b/block/Kconfig.iosched
@@ -65,6 +65,76 @@ config CFQ_GROUP_IOSCHED
---help---
Enable group IO scheduling in CFQ.
+config IOSCHED_BFQ
+ tristate "BFQ I/O scheduler"
+ depends on EXPERIMENTAL
+ default n
+ ---help---
+ The BFQ I/O scheduler tries to distribute bandwidth among
+ all processes according to their weights.
+ It aims at distributing the bandwidth as desired, independently of
+ the disk parameters and with any workload. It also tries to
+ guarantee low latency to interactive and soft real-time
+ applications. If compiled built-in (saying Y here), BFQ can
+ be configured to support hierarchical scheduling.
+
+config CGROUP_BFQIO
+ bool "BFQ hierarchical scheduling support"
+ depends on CGROUPS && IOSCHED_BFQ=y
+ default n
+ ---help---
+ Enable hierarchical scheduling in BFQ, using the cgroups
+ filesystem interface. The name of the subsystem will be
+ bfqio.
+
+config IOSCHED_FIOPS
+ tristate "IOPS based I/O scheduler"
+ default y
+ ---help---
+ This is an IOPS based I/O scheduler. It will try to distribute
+ IOPS equally among all processes in the system. It's mainly for
+ Flash based storage.
+
+config IOSCHED_SIO
+ tristate "Simple I/O scheduler"
+ default y
+ ---help---
+ The Simple I/O scheduler is an extremely simple scheduler,
+ based on noop and deadline, that relies on deadlines to
+ ensure fairness. The algorithm does not do any sorting but
+ basic merging, trying to keep a minimum overhead. It is aimed
+ mainly for aleatory access devices (eg: flash devices).
+
+config IOSCHED_SIOPLUS
+ tristate "Simple I/O scheduler plus"
+ default y
+ ---help---
+ The Simple I/O scheduler is an extremely simple scheduler,
+ based on noop and deadline, that relies on deadlines to
+ ensure fairness. The algorithm does not do any sorting but
+ basic merging, trying to keep a minimum overhead. It is aimed
+ mainly for aleatory access devices (eg: flash devices).
+
+config IOSCHED_ZEN
+ tristate "Zen I/O scheduler"
+ default y
+ ---help---
+ FCFS, dispatches are back-inserted, deadlines ensure fairness.
+ Should work best with devices where there is no travel delay.
+
+config IOSCHED_VR
+ tristate "V(R) I/O scheduler"
+ default y
+ ---help---
+ Requests are chosen according to SSTF with a penalty of rev_penalty
+ for switching head direction.
+
+config IOSCHED_TRIPNDROID
+ tristate "Tripndroid"
+ default y
+ ---help---
+ The Trip N Droid scheduler
+
choice
prompt "Default I/O scheduler"
default DEFAULT_CFQ
@@ -88,9 +158,30 @@ choice
config DEFAULT_CFQ
bool "CFQ" if IOSCHED_CFQ=y
+ config DEFAULT_BFQ
+ bool "BFQ" if IOSCHED_BFQ=y
+
+ config DEFAULT_FIOPS
+ bool "FIOPS" if IOSCHED_FIOPS=y
+
+ config DEFAULT_SIO
+ bool "SIO" if IOSCHED_SIO=y
+
+ config DEFAULT_SIOPLUS
+ bool "SIOPLUS" if IOSCHED_SIOPLUS=y
+
config DEFAULT_NOOP
bool "No-op"
+ config DEFAULT_ZEN
+ bool "ZEN" if IOSCHED_ZEN=y
+
+ config DEFAULT_VR
+ bool "VR" if IOSCHED_VR=y
+
+ config DEFAULT_TRIPNDROID
+ bool "TRIPNDROID" if IOSCHED_TRIPNDROID=y
+
endchoice
config DEFAULT_IOSCHED
@@ -98,7 +189,14 @@ config DEFAULT_IOSCHED
default "deadline" if DEFAULT_DEADLINE
default "row" if DEFAULT_ROW
default "cfq" if DEFAULT_CFQ
+ default "fiops" if DEFAULT_FIOPS
+ default "sio" if DEFAULT_SIO
+ default "sioplus" if DEFAULT_SIOPLUS
default "noop" if DEFAULT_NOOP
+ default "bfq" if DEFAULT_BFQ
+ default "zen" if DEFAULT_ZEN
+ default "vr" if DEFAULT_VR
+ default "tripndroid" if DEFAULT_TRIPNDROID
endmenu
diff --git a/block/Makefile b/block/Makefile
index b5e6637..9e525b2 100644
--- a/block/Makefile
+++ b/block/Makefile
@@ -17,6 +17,13 @@ obj-$(CONFIG_IOSCHED_DEADLINE) += deadline-iosched.o
obj-$(CONFIG_IOSCHED_ROW) += row-iosched.o
obj-$(CONFIG_IOSCHED_CFQ) += cfq-iosched.o
obj-$(CONFIG_IOSCHED_TEST) += test-iosched.o
+obj-$(CONFIG_IOSCHED_FIOPS) += fiops-iosched.o
+obj-$(CONFIG_IOSCHED_SIO) += sio-iosched.o
+obj-$(CONFIG_IOSCHED_SIOPLUS) += sioplus-iosched.o
+obj-$(CONFIG_IOSCHED_BFQ) += bfq-iosched.o
+obj-$(CONFIG_IOSCHED_ZEN) += zen-iosched.o
+obj-$(CONFIG_IOSCHED_VR) += vr-iosched.o
+obj-$(CONFIG_IOSCHED_TRIPNDROID) += tripndroid-iosched.o
obj-$(CONFIG_BLOCK_COMPAT) += compat_ioctl.o
obj-$(CONFIG_BLK_DEV_INTEGRITY) += blk-integrity.o
diff --git a/include/linux/cgroup_subsys.h b/include/linux/cgroup_subsys.h
index 0bd390c..cbf22b1 100644
--- a/include/linux/cgroup_subsys.h
+++ b/include/linux/cgroup_subsys.h
@@ -72,3 +72,9 @@ SUBSYS(net_prio)
#endif
/* */
+
+#ifdef CONFIG_CGROUP_BFQIO
+SUBSYS(bfqio)
+#endif
+
+/* */
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index b36b28f..3e71452 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -22,6 +22,7 @@ typedef void (elevator_bio_merged_fn) (struct request_queue *,
typedef int (elevator_dispatch_fn) (struct request_queue *, int);
typedef void (elevator_add_req_fn) (struct request_queue *, struct request *);
+typedef int (elevator_queue_empty_fn) (struct request_queue *);
typedef int (elevator_reinsert_req_fn) (struct request_queue *,
struct request *);
typedef bool (elevator_is_urgent_fn) (struct request_queue *);
@@ -55,6 +56,7 @@ struct elevator_ops
elevator_activate_req_fn *elevator_activate_req_fn;
elevator_deactivate_req_fn *elevator_deactivate_req_fn;
+ elevator_queue_empty_fn *elevator_queue_empty_fn;
elevator_completed_req_fn *elevator_completed_req_fn;
elevator_request_list_fn *elevator_former_req_fn;