aboutsummaryrefslogtreecommitdiffstats
path: root/block/cfq-iosched.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/cfq-iosched.c')
-rw-r--r--block/cfq-iosched.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index f0994aedb390..5e01a0a92c02 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -202,7 +202,7 @@ enum cfqq_state_flags {
202 CFQ_CFQQ_FLAG_prio_changed, /* task priority has changed */ 202 CFQ_CFQQ_FLAG_prio_changed, /* task priority has changed */
203 CFQ_CFQQ_FLAG_slice_new, /* no requests dispatched in slice */ 203 CFQ_CFQQ_FLAG_slice_new, /* no requests dispatched in slice */
204 CFQ_CFQQ_FLAG_sync, /* synchronous queue */ 204 CFQ_CFQQ_FLAG_sync, /* synchronous queue */
205 CFQ_CFQQ_FLAG_coop, /* has done a coop jump of the queue */ 205 CFQ_CFQQ_FLAG_coop, /* cfqq is shared */
206}; 206};
207 207
208#define CFQ_CFQQ_FNS(name) \ 208#define CFQ_CFQQ_FNS(name) \
@@ -950,11 +950,8 @@ static struct cfq_queue *cfq_get_next_queue(struct cfq_data *cfqd)
950static struct cfq_queue *cfq_set_active_queue(struct cfq_data *cfqd, 950static struct cfq_queue *cfq_set_active_queue(struct cfq_data *cfqd,
951 struct cfq_queue *cfqq) 951 struct cfq_queue *cfqq)
952{ 952{
953 if (!cfqq) { 953 if (!cfqq)
954 cfqq = cfq_get_next_queue(cfqd); 954 cfqq = cfq_get_next_queue(cfqd);
955 if (cfqq)
956 cfq_clear_cfqq_coop(cfqq);
957 }
958 955
959 __cfq_set_active_queue(cfqd, cfqq); 956 __cfq_set_active_queue(cfqd, cfqq);
960 return cfqq; 957 return cfqq;
@@ -1035,8 +1032,7 @@ static struct cfq_queue *cfqq_close(struct cfq_data *cfqd,
1035 * assumption. 1032 * assumption.
1036 */ 1033 */
1037static struct cfq_queue *cfq_close_cooperator(struct cfq_data *cfqd, 1034static struct cfq_queue *cfq_close_cooperator(struct cfq_data *cfqd,
1038 struct cfq_queue *cur_cfqq, 1035 struct cfq_queue *cur_cfqq)
1039 bool probe)
1040{ 1036{
1041 struct cfq_queue *cfqq; 1037 struct cfq_queue *cfqq;
1042 1038
@@ -1055,11 +1051,6 @@ static struct cfq_queue *cfq_close_cooperator(struct cfq_data *cfqd,
1055 if (!cfq_cfqq_sync(cfqq)) 1051 if (!cfq_cfqq_sync(cfqq))
1056 return NULL; 1052 return NULL;
1057 1053
1058 if (cfq_cfqq_coop(cfqq))
1059 return NULL;
1060
1061 if (!probe)
1062 cfq_mark_cfqq_coop(cfqq);
1063 return cfqq; 1054 return cfqq;
1064} 1055}
1065 1056
@@ -1243,7 +1234,7 @@ static struct cfq_queue *cfq_select_queue(struct cfq_data *cfqd)
1243 * cooperators and put the close queue at the front of the service 1234 * cooperators and put the close queue at the front of the service
1244 * tree. If possible, merge the expiring queue with the new cfqq. 1235 * tree. If possible, merge the expiring queue with the new cfqq.
1245 */ 1236 */
1246 new_cfqq = cfq_close_cooperator(cfqd, cfqq, 0); 1237 new_cfqq = cfq_close_cooperator(cfqd, cfqq);
1247 if (new_cfqq) { 1238 if (new_cfqq) {
1248 if (!cfqq->new_cfqq) 1239 if (!cfqq->new_cfqq)
1249 cfq_setup_merge(cfqq, new_cfqq); 1240 cfq_setup_merge(cfqq, new_cfqq);
@@ -2294,7 +2285,7 @@ static void cfq_completed_request(struct request_queue *q, struct request *rq)
2294 */ 2285 */
2295 if (cfq_slice_used(cfqq) || cfq_class_idle(cfqq)) 2286 if (cfq_slice_used(cfqq) || cfq_class_idle(cfqq))
2296 cfq_slice_expired(cfqd, 1); 2287 cfq_slice_expired(cfqd, 1);
2297 else if (cfqq_empty && !cfq_close_cooperator(cfqd, cfqq, 1) && 2288 else if (cfqq_empty && !cfq_close_cooperator(cfqd, cfqq) &&
2298 sync && !rq_noidle(rq)) 2289 sync && !rq_noidle(rq))
2299 cfq_arm_slice_timer(cfqd); 2290 cfq_arm_slice_timer(cfqd);
2300 } 2291 }
@@ -2395,6 +2386,7 @@ cfq_merge_cfqqs(struct cfq_data *cfqd, struct cfq_io_context *cic,
2395{ 2386{
2396 cfq_log_cfqq(cfqd, cfqq, "merging with queue %p", cfqq->new_cfqq); 2387 cfq_log_cfqq(cfqd, cfqq, "merging with queue %p", cfqq->new_cfqq);
2397 cic_set_cfqq(cic, cfqq->new_cfqq, 1); 2388 cic_set_cfqq(cic, cfqq->new_cfqq, 1);
2389 cfq_mark_cfqq_coop(cfqq->new_cfqq);
2398 cfq_put_queue(cfqq); 2390 cfq_put_queue(cfqq);
2399 return cic_to_cfqq(cic, 1); 2391 return cic_to_cfqq(cic, 1);
2400} 2392}