block-kconfig-iosched-default-selection.patch
PATCH 1/1 block-kconfig-iosched-default-selection.patch
Quoted 2 lines
From Michal Kaczmarski <[email protected]>
I think selection of a default IO scheduler via Kconfig can be a nice addition to the kernel.
--- Kconfig.iosched | 17 +++++++++++++++++ elevator.c | 35 ++++++++++++++++++++++++++--------- 2 files changed, 43 insertions(+), 9 deletions(-)
drivers/block/Kconfig.iosched +17 -0
@@ -38,4 +38,21 @@ among all processes in the system. It should provide a fair working environment, suitable for desktop systems. +choice + prompt "Default IO scheduler" + default IOSCHED_DEFAULT_AS + ---help--- + This option gives you possibility of choice the default IO + scheduler from selected to compile IO schedulers. + +config IOSCHED_DEFAULT_AS + bool "Anticipatory IO scheduler" if IOSCHED_AS +config IOSCHED_DEFAULT_DEADLINE + bool "Deadline IO scheduler" if IOSCHED_DEADLINE +config IOSCHED_DEFAULT_CFQ + bool "CFQ IO scheduler" if IOSCHED_CFQ +config IOSCHED_DEFAULT_NOOP + bool "NOOP IO scheduler" if IOSCHED_NOOP +endchoice + endmenu
drivers/block/elevator.c +26 -9
@@ -24,6 +24,7 @@* - completely modularize elevator setup and teardown * */ +#include <linux/config.h> #include <linux/kernel.h> #include <linux/fs.h> #include <linux/blkdev.h>
@@ -153,21 +154,37 @@static void elevator_setup_default (void ) { -/* -* check if default is set and exists -*/ -if (chosen_elevator[0 ] &&elevator_find (chosen_elevator)) -return ;#if defined(CONFIG_IOSCHED_AS ) +#if defined(CONFIG_IOSCHED_DEFAULT_AS )strcpy (chosen_elevator,"anticipatory" ); -#elif defined(CONFIG_IOSCHED_DEADLINE ) +#endif +#endif +#if defined(CONFIG_IOSCHED_DEADLINE ) +#if defined(CONFIG_IOSCHED_DEFAULT_DEADLINE )strcpy (chosen_elevator,"deadline" ); -#elif defined(CONFIG_IOSCHED_CFQ ) +#endif +#endif +#if defined(CONFIG_IOSCHED_CFQ ) +#if defined(CONFIG_IOSCHED_DEFAULT_CFQ )strcpy (chosen_elevator,"cfq" ); -#elif defined(CONFIG_IOSCHED_NOOP ) +#endif +#endif +#if defined(CONFIG_IOSCHED_NOOP ) +#if defined(CONFIG_IOSCHED_DEFAULT_NOOP )strcpy (chosen_elevator,"noop" ); -#else +#endif +#endif + +/* +* check if default is set and exists +*/ +if (chosen_elevator[0 ] &&elevator_find (chosen_elevator)) +return ; +else strcpy (chosen_elevator,"noop" ); + + +#if !defined(CONFIG_IOSCHED_AS ) && !defined(CONFIG_IOSCHED_DEADLINE ) && !defined(CONFIG_IOSCHED_CFQ ) && !defined(CONFIG_IOSCHED_NOOP )#error "You must build at least 1 IO scheduler into the kernel"#endif }
Quoted 3 lines · MichalK
Quoted 1 line
From Michal Kaczmarski <[email protected]>
I think selection of a default IO scheduler via
Kconfigcan be a nice addition to the kernel.
Please provide a useful subject line for your patches, rather than a filename.
Jeff