diff options
author | Tejun Heo <tj@kernel.org> | 2011-12-13 18:33:42 -0500 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2011-12-13 18:33:42 -0500 |
commit | 7e5a8794492e43e9eebb68a98a23be055888ccd0 (patch) | |
tree | cc049a23b2c994f910d3101860bc1c2ecb7aa35f /include/linux/elevator.h | |
parent | 3d3c2379feb177a5fd55bb0ed76776dc9d4f3243 (diff) |
block, cfq: move io_cq exit/release to blk-ioc.c
With kmem_cache managed by blk-ioc, io_cq exit/release can be moved to
blk-ioc too. The odd ->io_cq->exit/release() callbacks are replaced
with elevator_ops->elevator_exit_icq_fn() with unlinking from both ioc
and q, and freeing automatically handled by blk-ioc. The elevator
operation only need to perform exit operation specific to the elevator
- in cfq's case, exiting the cfqq's.
Also, clearing of io_cq's on q detach is moved to block core and
automatically performed on elevator switch and q release.
Because the q io_cq points to might be freed before RCU callback for
the io_cq runs, blk-ioc code should remember to which cache the io_cq
needs to be freed when the io_cq is released. New field
io_cq->__rcu_icq_cache is added for this purpose. As both the new
field and rcu_head are used only after io_cq is released and the
q/ioc_node fields aren't, they are put into unions.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/elevator.h')
-rw-r--r-- | include/linux/elevator.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/elevator.h b/include/linux/elevator.h index d3d3e28cbfd4..06e4dd568717 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h | |||
@@ -5,6 +5,8 @@ | |||
5 | 5 | ||
6 | #ifdef CONFIG_BLOCK | 6 | #ifdef CONFIG_BLOCK |
7 | 7 | ||
8 | struct io_cq; | ||
9 | |||
8 | typedef int (elevator_merge_fn) (struct request_queue *, struct request **, | 10 | typedef int (elevator_merge_fn) (struct request_queue *, struct request **, |
9 | struct bio *); | 11 | struct bio *); |
10 | 12 | ||
@@ -24,6 +26,7 @@ typedef struct request *(elevator_request_list_fn) (struct request_queue *, stru | |||
24 | typedef void (elevator_completed_req_fn) (struct request_queue *, struct request *); | 26 | typedef void (elevator_completed_req_fn) (struct request_queue *, struct request *); |
25 | typedef int (elevator_may_queue_fn) (struct request_queue *, int); | 27 | typedef int (elevator_may_queue_fn) (struct request_queue *, int); |
26 | 28 | ||
29 | typedef void (elevator_exit_icq_fn) (struct io_cq *); | ||
27 | typedef int (elevator_set_req_fn) (struct request_queue *, struct request *, gfp_t); | 30 | typedef int (elevator_set_req_fn) (struct request_queue *, struct request *, gfp_t); |
28 | typedef void (elevator_put_req_fn) (struct request *); | 31 | typedef void (elevator_put_req_fn) (struct request *); |
29 | typedef void (elevator_activate_req_fn) (struct request_queue *, struct request *); | 32 | typedef void (elevator_activate_req_fn) (struct request_queue *, struct request *); |
@@ -56,6 +59,8 @@ struct elevator_ops | |||
56 | elevator_request_list_fn *elevator_former_req_fn; | 59 | elevator_request_list_fn *elevator_former_req_fn; |
57 | elevator_request_list_fn *elevator_latter_req_fn; | 60 | elevator_request_list_fn *elevator_latter_req_fn; |
58 | 61 | ||
62 | elevator_exit_icq_fn *elevator_exit_icq_fn; | ||
63 | |||
59 | elevator_set_req_fn *elevator_set_req_fn; | 64 | elevator_set_req_fn *elevator_set_req_fn; |
60 | elevator_put_req_fn *elevator_put_req_fn; | 65 | elevator_put_req_fn *elevator_put_req_fn; |
61 | 66 | ||