public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: MichalK <fallow@neostrada.pl>
To: linux-kernel@vger.kernel.org
Subject: [PATCH 2.6.14-rc1-git5] block-kconfig-iosched-default-selection.patch
Date: Wed, 21 Sep 2005 22:29:20 +0200	[thread overview]
Message-ID: <4331C2A0.5050803@neostrada.pl> (raw)

[-- 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
 }

             reply	other threads:[~2005-09-21 20:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-21 20:29 MichalK [this message]
2005-09-22 22:59 ` [PATCH 2.6.14-rc1-git5] block-kconfig-iosched-default-selection.patch Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4331C2A0.5050803@neostrada.pl \
    --to=fallow@neostrada.pl \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox