From: Jens Axboe Date: Tue, 3 Nov 2009 20:14:39 +0000 (+0100) Subject: Merge branch 'for-linus' into for-2.6.33 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=2058297d2d045cb57138c33b87cfabcc80e65186;p=openwrt%2Fstaging%2Fblogic.git Merge branch 'for-linus' into for-2.6.33 Conflicts: block/cfq-iosched.c Signed-off-by: Jens Axboe --- 2058297d2d045cb57138c33b87cfabcc80e65186 diff --cc block/cfq-iosched.c index 8b5ba184cf91,aa1e9535e358..13b612f9f27a --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c @@@ -252,7 -195,8 +252,8 @@@ enum cfqq_state_flags CFQ_CFQQ_FLAG_prio_changed, /* task priority has changed */ CFQ_CFQQ_FLAG_slice_new, /* no requests dispatched in slice */ CFQ_CFQQ_FLAG_sync, /* synchronous queue */ - CFQ_CFQQ_FLAG_coop, /* has done a coop jump of the queue */ + CFQ_CFQQ_FLAG_coop, /* cfqq is shared */ + CFQ_CFQQ_FLAG_coop_preempt, /* coop preempt */ }; #define CFQ_CFQQ_FNS(name) \ @@@ -1068,9 -945,15 +1070,16 @@@ static struct cfq_queue *cfq_get_next_q static struct cfq_queue *cfq_set_active_queue(struct cfq_data *cfqd, struct cfq_queue *cfqq) { - if (!cfqq) + if (!cfqq) { cfqq = cfq_get_next_queue(cfqd); + + if (cfqq && !cfq_cfqq_coop_preempt(cfqq)) + cfq_clear_cfqq_coop(cfqq); + } + + if (cfqq) + cfq_clear_cfqq_coop_preempt(cfqq); + __cfq_set_active_queue(cfqd, cfqq); return cfqq; } @@@ -2424,8 -2071,16 +2433,17 @@@ cfq_should_preempt(struct cfq_data *cfq * if this request is as-good as one we would expect from the * current cfqq, let it preempt */ - if (cfq_rq_close(cfqd, rq) && (!cfq_cfqq_coop(new_cfqq) || + if (cfq_rq_close(cfqd, cfqq, rq)) ++ if (cfq_rq_close(cfqd, cfqq, rq) && (!cfq_cfqq_coop(new_cfqq) || + cfqd->busy_queues == 1)) { + /* + * Mark new queue coop_preempt, so its coop flag will not be + * cleared when new queue gets scheduled at the very first time + */ + cfq_mark_cfqq_coop_preempt(new_cfqq); + cfq_mark_cfqq_coop(new_cfqq); return true; + } return false; }