]> bbs.cooldavid.org Git - net-next-2.6.git/commit - include/linux/blkdev.h
[BLOCK] Reimplement elevator switch
authorTejun Heo <htejun@gmail.com>
Fri, 28 Oct 2005 06:29:39 +0000 (08:29 +0200)
committerJens Axboe <axboe@nelson.home.kernel.dk>
Fri, 28 Oct 2005 06:48:12 +0000 (08:48 +0200)
commitcb98fc8bb9c141009e2bda99c0db39d387e142cf
tree8957f8a79f39c3e6633a0dbb165ced8b530aca0c
parentcb19833dccb32f97cacbfff834b53523915f13f6
[BLOCK] Reimplement elevator switch

 This patch reimplements elevator switch.  This patch assumes generic
dispatch queue patchset is applied.

 * Each request is tagged with REQ_ELVPRIV flag if it has its elevator
   private data set.
 * Requests which doesn't have REQ_ELVPRIV flag set never enter
   iosched.  They are always directly back inserted to dispatch queue.
   Of course, elevator_put_req_fn is called only for requests which
   have its REQ_ELVPRIV set.
 * Request queue maintains the current number of requests which have
   its elevator data set (elevator_set_req_fn called) in
   q->rq->elvpriv.
 * If a request queue has QUEUE_FLAG_BYPASS set, elevator private data
   is not allocated for new requests.

 To switch to another iosched, we set QUEUE_FLAG_BYPASS and wait until
elvpriv goes to zero; then, we attach the new iosched and clears
QUEUE_FLAG_BYPASS.  New implementation is much simpler and main code
paths are less cluttered, IMHO.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jens Axboe <axboe@suse.de>
drivers/block/elevator.c
drivers/block/ll_rw_blk.c
include/linux/blkdev.h