aboutsummaryrefslogtreecommitdiffstats
path: root/block/cfq-iosched.c
diff options
context:
space:
mode:
authorJens Axboe <jaxboe@fusionio.com>2011-07-01 10:17:13 -0400
committerJens Axboe <jaxboe@fusionio.com>2011-07-01 10:17:13 -0400
commit04bf7869ca0fd12009aee301cac2264a36df4d98 (patch)
tree66cb81ebf8b76560a31433c2c493dc430c914af9 /block/cfq-iosched.c
parentd2f31a5fd60d168b00fc4f7617b68a1287b21e90 (diff)
parent7b28afe01ab6ffb5f152f47831b44933facd2328 (diff)
Merge branch 'for-linus' into for-3.1/core
Conflicts: block/blk-throttle.c block/cfq-iosched.c Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'block/cfq-iosched.c')
-rw-r--r--block/cfq-iosched.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 3d403a128971..b2e1c75e4fbe 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -185,7 +185,7 @@ struct cfq_group {
185 int nr_cfqq; 185 int nr_cfqq;
186 186
187 /* 187 /*
188 * Per group busy queus average. Useful for workload slice calc. We 188 * Per group busy queues average. Useful for workload slice calc. We
189 * create the array for each prio class but at run time it is used 189 * create the array for each prio class but at run time it is used
190 * only for RT and BE class and slot for IDLE class remains unused. 190 * only for RT and BE class and slot for IDLE class remains unused.
191 * This is primarily done to avoid confusion and a gcc warning. 191 * This is primarily done to avoid confusion and a gcc warning.
@@ -369,16 +369,16 @@ CFQ_CFQQ_FNS(wait_busy);
369#define cfq_log_cfqq(cfqd, cfqq, fmt, args...) \ 369#define cfq_log_cfqq(cfqd, cfqq, fmt, args...) \
370 blk_add_trace_msg((cfqd)->queue, "cfq%d%c %s " fmt, (cfqq)->pid, \ 370 blk_add_trace_msg((cfqd)->queue, "cfq%d%c %s " fmt, (cfqq)->pid, \
371 cfq_cfqq_sync((cfqq)) ? 'S' : 'A', \ 371 cfq_cfqq_sync((cfqq)) ? 'S' : 'A', \
372 blkg_path(&(cfqq)->cfqg->blkg), ##args); 372 blkg_path(&(cfqq)->cfqg->blkg), ##args)
373 373
374#define cfq_log_cfqg(cfqd, cfqg, fmt, args...) \ 374#define cfq_log_cfqg(cfqd, cfqg, fmt, args...) \
375 blk_add_trace_msg((cfqd)->queue, "%s " fmt, \ 375 blk_add_trace_msg((cfqd)->queue, "%s " fmt, \
376 blkg_path(&(cfqg)->blkg), ##args); \ 376 blkg_path(&(cfqg)->blkg), ##args) \
377 377
378#else 378#else
379#define cfq_log_cfqq(cfqd, cfqq, fmt, args...) \ 379#define cfq_log_cfqq(cfqd, cfqq, fmt, args...) \
380 blk_add_trace_msg((cfqd)->queue, "cfq%d " fmt, (cfqq)->pid, ##args) 380 blk_add_trace_msg((cfqd)->queue, "cfq%d " fmt, (cfqq)->pid, ##args)
381#define cfq_log_cfqg(cfqd, cfqg, fmt, args...) do {} while (0); 381#define cfq_log_cfqg(cfqd, cfqg, fmt, args...) do {} while (0)
382#endif 382#endif
383#define cfq_log(cfqd, fmt, args...) \ 383#define cfq_log(cfqd, fmt, args...) \
384 blk_add_trace_msg((cfqd)->queue, "cfq " fmt, ##args) 384 blk_add_trace_msg((cfqd)->queue, "cfq " fmt, ##args)
@@ -2768,11 +2768,14 @@ static void __cfq_exit_single_io_context(struct cfq_data *cfqd,
2768 smp_wmb(); 2768 smp_wmb();
2769 cic->key = cfqd_dead_key(cfqd); 2769 cic->key = cfqd_dead_key(cfqd);
2770 2770
2771 rcu_read_lock();
2771 if (rcu_dereference(ioc->ioc_data) == cic) { 2772 if (rcu_dereference(ioc->ioc_data) == cic) {
2773 rcu_read_unlock();
2772 spin_lock(&ioc->lock); 2774 spin_lock(&ioc->lock);
2773 rcu_assign_pointer(ioc->ioc_data, NULL); 2775 rcu_assign_pointer(ioc->ioc_data, NULL);
2774 spin_unlock(&ioc->lock); 2776 spin_unlock(&ioc->lock);
2775 } 2777 } else
2778 rcu_read_unlock();
2776 2779
2777 if (cic->cfqq[BLK_RW_ASYNC]) { 2780 if (cic->cfqq[BLK_RW_ASYNC]) {
2778 cfq_exit_cfqq(cfqd, cic->cfqq[BLK_RW_ASYNC]); 2781 cfq_exit_cfqq(cfqd, cic->cfqq[BLK_RW_ASYNC]);
@@ -3079,7 +3082,8 @@ cfq_drop_dead_cic(struct cfq_data *cfqd, struct io_context *ioc,
3079 3082
3080 spin_lock_irqsave(&ioc->lock, flags); 3083 spin_lock_irqsave(&ioc->lock, flags);
3081 3084
3082 BUG_ON(ioc->ioc_data == cic); 3085 BUG_ON(rcu_dereference_check(ioc->ioc_data,
3086 lockdep_is_held(&ioc->lock)) == cic);
3083 3087
3084 radix_tree_delete(&ioc->radix_root, cfqd->cic_index); 3088 radix_tree_delete(&ioc->radix_root, cfqd->cic_index);
3085 hlist_del_rcu(&cic->cic_list); 3089 hlist_del_rcu(&cic->cic_list);
@@ -3785,9 +3789,6 @@ new_queue:
3785 return 0; 3789 return 0;
3786 3790
3787queue_fail: 3791queue_fail:
3788 if (cic)
3789 put_io_context(cic->ioc);
3790
3791 cfq_schedule_dispatch(cfqd); 3792 cfq_schedule_dispatch(cfqd);
3792 spin_unlock_irqrestore(q->queue_lock, flags); 3793 spin_unlock_irqrestore(q->queue_lock, flags);
3793 cfq_log(cfqd, "set_request fail"); 3794 cfq_log(cfqd, "set_request fail");