Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 11827
b: refs/heads/master
c: 131dda7
h: refs/heads/master
i:
  11825: 2879c26
  11823: 18cce6f
v: v3
  • Loading branch information
Nate Diller authored and Linus Torvalds committed Oct 31, 2005
1 parent 81431d5 commit 7fae2f1
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6dd69f1061bfdeca230509b173438e0731bff767
refs/heads/master: 131dda7f8965a6b794dcde1d84f3ba5951a4d641
28 changes: 28 additions & 0 deletions trunk/drivers/block/Kconfig.iosched
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,32 @@ config IOSCHED_CFQ
among all processes in the system. It should provide a fair
working environment, suitable for desktop systems.

choice
prompt "Default I/O scheduler"
default DEFAULT_AS
help
Select the I/O scheduler which will be used by default for all
block devices.

config DEFAULT_AS
bool "Anticipatory" if IOSCHED_AS

config DEFAULT_DEADLINE
bool "Deadline" if IOSCHED_DEADLINE

config DEFAULT_CFQ
bool "CFQ" if IOSCHED_CFQ

config DEFAULT_NOOP
bool "No-op"

endchoice

config DEFAULT_IOSCHED
string
default "anticipatory" if DEFAULT_AS
default "deadline" if DEFAULT_DEADLINE
default "cfq" if DEFAULT_CFQ
default "noop" if DEFAULT_NOOP

endmenu
27 changes: 10 additions & 17 deletions trunk/drivers/block/elevator.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,24 +147,17 @@ static void elevator_setup_default(void)
struct elevator_type *e;

/*
* check if default is set and exists
* If default has not been set, use the compiled-in selection.
*/
if (chosen_elevator[0] && (e = elevator_get(chosen_elevator))) {
elevator_put(e);
return;
}

#if defined(CONFIG_IOSCHED_AS)
strcpy(chosen_elevator, "anticipatory");
#elif defined(CONFIG_IOSCHED_DEADLINE)
strcpy(chosen_elevator, "deadline");
#elif defined(CONFIG_IOSCHED_CFQ)
strcpy(chosen_elevator, "cfq");
#elif defined(CONFIG_IOSCHED_NOOP)
strcpy(chosen_elevator, "noop");
#else
#error "You must build at least 1 IO scheduler into the kernel"
#endif
if (!chosen_elevator[0])
strcpy(chosen_elevator, CONFIG_DEFAULT_IOSCHED);

/*
* If the given scheduler is not available, fall back to no-op.
*/
if (!(e = elevator_find(chosen_elevator)))
strcpy(chosen_elevator, "noop");
elevator_put(e);
}

static int __init elevator_setup(char *str)
Expand Down

0 comments on commit 7fae2f1

Please sign in to comment.