diff options
-rw-r--r-- | Documentation/block/switching-sched.txt | 22 | ||||
-rw-r--r-- | block/elevator.c | 2 | ||||
-rw-r--r-- | block/ll_rw_blk.c | 4 | ||||
-rw-r--r-- | fs/splice.c | 13 | ||||
-rw-r--r-- | kernel/fork.c | 1 |
5 files changed, 37 insertions, 5 deletions
diff --git a/Documentation/block/switching-sched.txt b/Documentation/block/switching-sched.txt new file mode 100644 index 000000000000..5fa130a67531 --- /dev/null +++ b/Documentation/block/switching-sched.txt | |||
@@ -0,0 +1,22 @@ | |||
1 | As of the Linux 2.6.10 kernel, it is now possible to change the | ||
2 | IO scheduler for a given block device on the fly (thus making it possible, | ||
3 | for instance, to set the CFQ scheduler for the system default, but | ||
4 | set a specific device to use the anticipatory or noop schedulers - which | ||
5 | can improve that device's throughput). | ||
6 | |||
7 | To set a specific scheduler, simply do this: | ||
8 | |||
9 | echo SCHEDNAME > /sys/block/DEV/queue/scheduler | ||
10 | |||
11 | where SCHEDNAME is the name of a defined IO scheduler, and DEV is the | ||
12 | device name (hda, hdb, sga, or whatever you happen to have). | ||
13 | |||
14 | The list of defined schedulers can be found by simply doing | ||
15 | a "cat /sys/block/DEV/queue/scheduler" - the list of valid names | ||
16 | will be displayed, with the currently selected scheduler in brackets: | ||
17 | |||
18 | # cat /sys/block/hda/queue/scheduler | ||
19 | noop anticipatory deadline [cfq] | ||
20 | # echo anticipatory > /sys/block/hda/queue/scheduler | ||
21 | # cat /sys/block/hda/queue/scheduler | ||
22 | noop [anticipatory] deadline cfq | ||
diff --git a/block/elevator.c b/block/elevator.c index 0d6be03d929e..29825792cbd5 100644 --- a/block/elevator.c +++ b/block/elevator.c | |||
@@ -895,10 +895,8 @@ ssize_t elv_iosched_show(request_queue_t *q, char *name) | |||
895 | EXPORT_SYMBOL(elv_dispatch_sort); | 895 | EXPORT_SYMBOL(elv_dispatch_sort); |
896 | EXPORT_SYMBOL(elv_add_request); | 896 | EXPORT_SYMBOL(elv_add_request); |
897 | EXPORT_SYMBOL(__elv_add_request); | 897 | EXPORT_SYMBOL(__elv_add_request); |
898 | EXPORT_SYMBOL(elv_requeue_request); | ||
899 | EXPORT_SYMBOL(elv_next_request); | 898 | EXPORT_SYMBOL(elv_next_request); |
900 | EXPORT_SYMBOL(elv_dequeue_request); | 899 | EXPORT_SYMBOL(elv_dequeue_request); |
901 | EXPORT_SYMBOL(elv_queue_empty); | 900 | EXPORT_SYMBOL(elv_queue_empty); |
902 | EXPORT_SYMBOL(elv_completed_request); | ||
903 | EXPORT_SYMBOL(elevator_exit); | 901 | EXPORT_SYMBOL(elevator_exit); |
904 | EXPORT_SYMBOL(elevator_init); | 902 | EXPORT_SYMBOL(elevator_init); |
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index e112d1a5dab6..1755c053fd68 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c | |||
@@ -1554,7 +1554,7 @@ void blk_plug_device(request_queue_t *q) | |||
1554 | * don't plug a stopped queue, it must be paired with blk_start_queue() | 1554 | * don't plug a stopped queue, it must be paired with blk_start_queue() |
1555 | * which will restart the queueing | 1555 | * which will restart the queueing |
1556 | */ | 1556 | */ |
1557 | if (test_bit(QUEUE_FLAG_STOPPED, &q->queue_flags)) | 1557 | if (blk_queue_stopped(q)) |
1558 | return; | 1558 | return; |
1559 | 1559 | ||
1560 | if (!test_and_set_bit(QUEUE_FLAG_PLUGGED, &q->queue_flags)) { | 1560 | if (!test_and_set_bit(QUEUE_FLAG_PLUGGED, &q->queue_flags)) { |
@@ -1587,7 +1587,7 @@ EXPORT_SYMBOL(blk_remove_plug); | |||
1587 | */ | 1587 | */ |
1588 | void __generic_unplug_device(request_queue_t *q) | 1588 | void __generic_unplug_device(request_queue_t *q) |
1589 | { | 1589 | { |
1590 | if (unlikely(test_bit(QUEUE_FLAG_STOPPED, &q->queue_flags))) | 1590 | if (unlikely(blk_queue_stopped(q))) |
1591 | return; | 1591 | return; |
1592 | 1592 | ||
1593 | if (!blk_remove_plug(q)) | 1593 | if (!blk_remove_plug(q)) |
diff --git a/fs/splice.c b/fs/splice.c index 22fac87e90b3..0559e7577a04 100644 --- a/fs/splice.c +++ b/fs/splice.c | |||
@@ -275,6 +275,15 @@ __generic_file_splice_read(struct file *in, loff_t *ppos, | |||
275 | error = 0; | 275 | error = 0; |
276 | bytes = 0; | 276 | bytes = 0; |
277 | for (i = 0; i < nr_pages; i++, index++) { | 277 | for (i = 0; i < nr_pages; i++, index++) { |
278 | unsigned int this_len; | ||
279 | |||
280 | if (!len) | ||
281 | break; | ||
282 | |||
283 | /* | ||
284 | * this_len is the max we'll use from this page | ||
285 | */ | ||
286 | this_len = min(len, PAGE_CACHE_SIZE - loff); | ||
278 | find_page: | 287 | find_page: |
279 | /* | 288 | /* |
280 | * lookup the page for this index | 289 | * lookup the page for this index |
@@ -366,11 +375,13 @@ readpage: | |||
366 | * force quit after adding this page | 375 | * force quit after adding this page |
367 | */ | 376 | */ |
368 | nr_pages = i; | 377 | nr_pages = i; |
378 | this_len = min(this_len, loff); | ||
369 | } | 379 | } |
370 | } | 380 | } |
371 | fill_it: | 381 | fill_it: |
372 | pages[i] = page; | 382 | pages[i] = page; |
373 | bytes += PAGE_CACHE_SIZE - loff; | 383 | bytes += this_len; |
384 | len -= this_len; | ||
374 | loff = 0; | 385 | loff = 0; |
375 | } | 386 | } |
376 | 387 | ||
diff --git a/kernel/fork.c b/kernel/fork.c index 34515772611e..d2fa57d480d4 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -180,6 +180,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig) | |||
180 | atomic_set(&tsk->usage,2); | 180 | atomic_set(&tsk->usage,2); |
181 | atomic_set(&tsk->fs_excl, 0); | 181 | atomic_set(&tsk->fs_excl, 0); |
182 | tsk->btrace_seq = 0; | 182 | tsk->btrace_seq = 0; |
183 | tsk->splice_pipe = NULL; | ||
183 | return tsk; | 184 | return tsk; |
184 | } | 185 | } |
185 | 186 | ||