aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/block/switching-sched.txt22
-rw-r--r--block/elevator.c2
-rw-r--r--block/ll_rw_blk.c4
-rw-r--r--fs/splice.c13
-rw-r--r--kernel/fork.c1
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 @@
1As of the Linux 2.6.10 kernel, it is now possible to change the
2IO scheduler for a given block device on the fly (thus making it possible,
3for instance, to set the CFQ scheduler for the system default, but
4set a specific device to use the anticipatory or noop schedulers - which
5can improve that device's throughput).
6
7To set a specific scheduler, simply do this:
8
9echo SCHEDNAME > /sys/block/DEV/queue/scheduler
10
11where SCHEDNAME is the name of a defined IO scheduler, and DEV is the
12device name (hda, hdb, sga, or whatever you happen to have).
13
14The list of defined schedulers can be found by simply doing
15a "cat /sys/block/DEV/queue/scheduler" - the list of valid names
16will be displayed, with the currently selected scheduler in brackets:
17
18# cat /sys/block/hda/queue/scheduler
19noop anticipatory deadline [cfq]
20# echo anticipatory > /sys/block/hda/queue/scheduler
21# cat /sys/block/hda/queue/scheduler
22noop [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)
895EXPORT_SYMBOL(elv_dispatch_sort); 895EXPORT_SYMBOL(elv_dispatch_sort);
896EXPORT_SYMBOL(elv_add_request); 896EXPORT_SYMBOL(elv_add_request);
897EXPORT_SYMBOL(__elv_add_request); 897EXPORT_SYMBOL(__elv_add_request);
898EXPORT_SYMBOL(elv_requeue_request);
899EXPORT_SYMBOL(elv_next_request); 898EXPORT_SYMBOL(elv_next_request);
900EXPORT_SYMBOL(elv_dequeue_request); 899EXPORT_SYMBOL(elv_dequeue_request);
901EXPORT_SYMBOL(elv_queue_empty); 900EXPORT_SYMBOL(elv_queue_empty);
902EXPORT_SYMBOL(elv_completed_request);
903EXPORT_SYMBOL(elevator_exit); 901EXPORT_SYMBOL(elevator_exit);
904EXPORT_SYMBOL(elevator_init); 902EXPORT_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 */
1588void __generic_unplug_device(request_queue_t *q) 1588void __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);
278find_page: 287find_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 }
371fill_it: 381fill_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