summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2002-05-28 05:39:17 -0700
committerJens Axboe <axboe@suse.de>2002-05-28 05:39:17 -0700
commiteba5b46c3c8002cf528a0472b70356d77438ca98 (patch)
treec053b6a6e69830a23230d966d4f1e8f90cadc851 /fs
parentc43626f4822b7c6183fa864b53d3b39c2180cdae (diff)
[PATCH] block plugging reworked
This patch provides the ability for a block driver to signal it's too busy to receive more work and temporarily halt the request queue. In concept it's similar to the networking netif_{start,stop}_queue helpers. To do this cleanly, I've ripped out the old tq_disk task queue. Instead an internal list of plugged queues is maintained which will honor the current queue state (see QUEUE_FLAG_STOPPED bit). Execution of request_fn has been moved to tasklet context. blk_run_queues() provides similar functionality to the old run_task_queue(&tq_disk). Now, this only works at the request_fn level and not at the make_request_fn level. This is on purpose: drivers working at the make_request_fn level are essentially providing a piece of the block level infrastructure themselves. There are basically two reasons for doing make_request_fn style setups: o block remappers. start/stop functionality will be done at the target device in this case, which is the level that will signal hardware full (or continue) anyways. o drivers who wish to receive single entities of "buffers" and not merged requests etc. This could use the start/stop functionality. I'd suggest _still_ using a request_fn for these, but set the queue options so that no merging etc ever takes place. This has the added bonus of providing the usual request depletion throttling at the block level.
Diffstat (limited to 'fs')
-rw-r--r--fs/buffer.c8
-rw-r--r--fs/iobuf.c2
-rw-r--r--fs/jbd/checkpoint.c2
-rw-r--r--fs/reiserfs/buffer2.c2
4 files changed, 7 insertions, 7 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index b0f89b75a99c..ce8f2d8a233d 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -138,7 +138,7 @@ void __wait_on_buffer(struct buffer_head * bh)
get_bh(bh);
add_wait_queue(wq, &wait);
do {
- run_task_queue(&tq_disk);
+ blk_run_queues();
set_task_state(tsk, TASK_UNINTERRUPTIBLE);
if (!buffer_locked(bh))
break;
@@ -487,7 +487,7 @@ static void free_more_memory(void)
wakeup_bdflush();
try_to_free_pages(zone, GFP_NOFS, 0);
- run_task_queue(&tq_disk);
+ blk_run_queues();
__set_current_state(TASK_RUNNING);
yield();
}
@@ -1004,7 +1004,7 @@ no_grow:
* the reserve list is empty, we're sure there are
* async buffer heads in use.
*/
- run_task_queue(&tq_disk);
+ blk_run_queues();
free_more_memory();
goto try_again;
@@ -2452,7 +2452,7 @@ EXPORT_SYMBOL(try_to_free_buffers);
int block_sync_page(struct page *page)
{
- run_task_queue(&tq_disk);
+ blk_run_queues();
return 0;
}
diff --git a/fs/iobuf.c b/fs/iobuf.c
index ab2188fc3e7a..62c44534c68a 100644
--- a/fs/iobuf.c
+++ b/fs/iobuf.c
@@ -112,7 +112,7 @@ void kiobuf_wait_for_io(struct kiobuf *kiobuf)
repeat:
set_task_state(tsk, TASK_UNINTERRUPTIBLE);
if (atomic_read(&kiobuf->io_count) != 0) {
- run_task_queue(&tq_disk);
+ blk_run_queues();
schedule();
if (atomic_read(&kiobuf->io_count) != 0)
goto repeat;
diff --git a/fs/jbd/checkpoint.c b/fs/jbd/checkpoint.c
index 17a94591d021..428dcd822dec 100644
--- a/fs/jbd/checkpoint.c
+++ b/fs/jbd/checkpoint.c
@@ -179,7 +179,7 @@ static void __flush_batch(struct buffer_head **bhs, int *batch_count)
spin_unlock(&journal_datalist_lock);
ll_rw_block(WRITE, *batch_count, bhs);
- run_task_queue(&tq_disk);
+ blk_run_queues();
spin_lock(&journal_datalist_lock);
for (i = 0; i < *batch_count; i++) {
struct buffer_head *bh = bhs[i];
diff --git a/fs/reiserfs/buffer2.c b/fs/reiserfs/buffer2.c
index 3b2252678210..a078187b1922 100644
--- a/fs/reiserfs/buffer2.c
+++ b/fs/reiserfs/buffer2.c
@@ -32,7 +32,7 @@ void wait_buffer_until_released (const struct buffer_head * bh)
bh, repeat_counter, buffer_journaled(bh) ? ' ' : '!',
buffer_journal_dirty(bh) ? ' ' : '!');
}
- run_task_queue(&tq_disk);
+ blk_run_queues();
yield();
}
if (repeat_counter > 30000000) {