* [PATCH 2.6.14-rc1-git5] block-kconfig-iosched-default-selection.patch
@ 2005-09-21 20:29 MichalK
2005-09-22 22:59 ` Jeff Garzik
0 siblings, 1 reply; 2+ messages in thread
From: MichalK @ 2005-09-21 20:29 UTC (permalink / raw)
To: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1 bytes --]
[-- Attachment #2: block-kconfig-iosched-default-selection.patch --]
[-- Type: text/x-patch, Size: 2799 bytes --]
>From Michal Kaczmarski <fallow@neostrada.pl>
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(-)
diff -Naur a/drivers/block/Kconfig.iosched b/drivers/block/Kconfig.iosched
--- a/drivers/block/Kconfig.iosched 2005-08-29 01:41:01.000000000 +0200
+++ b/drivers/block/Kconfig.iosched 2005-09-21 19:09:56.000000000 +0200
@@ -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
diff -Naur a/drivers/block/elevator.c b/drivers/block/elevator.c
--- a/drivers/block/elevator.c 2005-08-29 01:41:01.000000000 +0200
+++ b/drivers/block/elevator.c 2005-09-21 19:33:10.000000000 +0200
@@ -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
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 2.6.14-rc1-git5] block-kconfig-iosched-default-selection.patch
2005-09-21 20:29 [PATCH 2.6.14-rc1-git5] block-kconfig-iosched-default-selection.patch MichalK
@ 2005-09-22 22:59 ` Jeff Garzik
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2005-09-22 22:59 UTC (permalink / raw)
To: MichalK; +Cc: linux-kernel
MichalK wrote:
>>From Michal Kaczmarski <fallow@neostrada.pl>
>
> I think selection of a default IO scheduler via Kconfig
> can be a nice addition to the kernel.
Please provide a useful subject line for your patches, rather than a
filename.
Jeff
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-09-22 22:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-21 20:29 [PATCH 2.6.14-rc1-git5] block-kconfig-iosched-default-selection.patch MichalK
2005-09-22 22:59 ` Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).