diff options
author | Jeff Moyer <jmoyer@redhat.com> | 2009-10-23 17:14:51 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-10-26 09:34:47 -0400 |
commit | b3b6d0408c953524f979468562e7e210d8634150 (patch) | |
tree | 1556cb393f2edc09e64c8961f6792cbb79b4e288 /block | |
parent | df5fe3e8e13883f58dc97489076bbcc150789a21 (diff) |
cfq: change the meaning of the cfqq_coop flag
The flag used to indicate that a cfqq was allowed to jump ahead in the
scheduling order due to submitting a request close to the queue that
just executed. Since closely cooperating queues are now merged, the flag
holds little meaning. Change it to indicate that multiple queues were
merged. This will later be used to allow the breaking up of merged queues
when they are no longer cooperating.
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/cfq-iosched.c | 20 |
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) | |||
950 | static struct cfq_queue *cfq_set_active_queue(struct cfq_data *cfqd, | 950 | static 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 | */ |
1037 | static struct cfq_queue *cfq_close_cooperator(struct cfq_data *cfqd, | 1034 | static 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 | } |