diff options
| author | Jens Axboe <jens.axboe@oracle.com> | 2008-02-01 05:34:49 -0500 |
|---|---|---|
| committer | Jens Axboe <jens.axboe@oracle.com> | 2008-02-01 05:34:49 -0500 |
| commit | 3bc217ffe6774e7971d6a7ce6350ce806ebab044 (patch) | |
| tree | b1ccad14a0c23f12248092feb867d2e311db59f0 | |
| parent | 8bdd3f8a6993fef2f364aca6e1a59559405773a2 (diff) | |
block: kill swap_io_context()
It blindly copies everything in the io_context, including the lock.
That doesn't work so well for either lock ordering or lockdep.
There seems zero point in swapping io contexts on a request to request
merge, so the best point of action is to just remove it.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
| -rw-r--r-- | block/as-iosched.c | 14 | ||||
| -rw-r--r-- | block/blk-ioc.c | 9 | ||||
| -rw-r--r-- | include/linux/blkdev.h | 1 |
3 files changed, 0 insertions, 24 deletions
diff --git a/block/as-iosched.c b/block/as-iosched.c index 612d64096300..8c3946787dbb 100644 --- a/block/as-iosched.c +++ b/block/as-iosched.c | |||
| @@ -1268,22 +1268,8 @@ static void as_merged_requests(struct request_queue *q, struct request *req, | |||
| 1268 | */ | 1268 | */ |
| 1269 | if (!list_empty(&req->queuelist) && !list_empty(&next->queuelist)) { | 1269 | if (!list_empty(&req->queuelist) && !list_empty(&next->queuelist)) { |
| 1270 | if (time_before(rq_fifo_time(next), rq_fifo_time(req))) { | 1270 | if (time_before(rq_fifo_time(next), rq_fifo_time(req))) { |
| 1271 | struct io_context *rioc = RQ_IOC(req); | ||
| 1272 | struct io_context *nioc = RQ_IOC(next); | ||
| 1273 | |||
| 1274 | list_move(&req->queuelist, &next->queuelist); | 1271 | list_move(&req->queuelist, &next->queuelist); |
| 1275 | rq_set_fifo_time(req, rq_fifo_time(next)); | 1272 | rq_set_fifo_time(req, rq_fifo_time(next)); |
| 1276 | /* | ||
| 1277 | * Don't copy here but swap, because when anext is | ||
| 1278 | * removed below, it must contain the unused context | ||
| 1279 | */ | ||
| 1280 | if (rioc != nioc) { | ||
| 1281 | double_spin_lock(&rioc->lock, &nioc->lock, | ||
| 1282 | rioc < nioc); | ||
| 1283 | swap_io_context(&rioc, &nioc); | ||
| 1284 | double_spin_unlock(&rioc->lock, &nioc->lock, | ||
| 1285 | rioc < nioc); | ||
| 1286 | } | ||
| 1287 | } | 1273 | } |
| 1288 | } | 1274 | } |
| 1289 | 1275 | ||
diff --git a/block/blk-ioc.c b/block/blk-ioc.c index 6d1675508eb5..80245dc30c75 100644 --- a/block/blk-ioc.c +++ b/block/blk-ioc.c | |||
| @@ -176,15 +176,6 @@ void copy_io_context(struct io_context **pdst, struct io_context **psrc) | |||
| 176 | } | 176 | } |
| 177 | EXPORT_SYMBOL(copy_io_context); | 177 | EXPORT_SYMBOL(copy_io_context); |
| 178 | 178 | ||
| 179 | void swap_io_context(struct io_context **ioc1, struct io_context **ioc2) | ||
| 180 | { | ||
| 181 | struct io_context *temp; | ||
| 182 | temp = *ioc1; | ||
| 183 | *ioc1 = *ioc2; | ||
| 184 | *ioc2 = temp; | ||
| 185 | } | ||
| 186 | EXPORT_SYMBOL(swap_io_context); | ||
| 187 | |||
| 188 | int __init blk_ioc_init(void) | 179 | int __init blk_ioc_init(void) |
| 189 | { | 180 | { |
| 190 | iocontext_cachep = kmem_cache_create("blkdev_ioc", | 181 | iocontext_cachep = kmem_cache_create("blkdev_ioc", |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index cf170391c474..90392a9d7a9c 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
| @@ -39,7 +39,6 @@ void exit_io_context(void); | |||
| 39 | struct io_context *get_io_context(gfp_t gfp_flags, int node); | 39 | struct io_context *get_io_context(gfp_t gfp_flags, int node); |
| 40 | struct io_context *alloc_io_context(gfp_t gfp_flags, int node); | 40 | struct io_context *alloc_io_context(gfp_t gfp_flags, int node); |
| 41 | void copy_io_context(struct io_context **pdst, struct io_context **psrc); | 41 | void copy_io_context(struct io_context **pdst, struct io_context **psrc); |
| 42 | void swap_io_context(struct io_context **ioc1, struct io_context **ioc2); | ||
| 43 | 42 | ||
| 44 | struct request; | 43 | struct request; |
| 45 | typedef void (rq_end_io_fn)(struct request *, int); | 44 | typedef void (rq_end_io_fn)(struct request *, int); |
