diff options
Diffstat (limited to 'block/cfq-iosched.c')
| -rw-r--r-- | block/cfq-iosched.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index da69b079725f..b7e9c7feeab2 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
| @@ -38,9 +38,13 @@ static const u64 cfq_target_latency = (u64)NSEC_PER_SEC * 3/10; /* 300 ms */ | |||
| 38 | static const int cfq_hist_divisor = 4; | 38 | static const int cfq_hist_divisor = 4; |
| 39 | 39 | ||
| 40 | /* | 40 | /* |
| 41 | * offset from end of service tree | 41 | * offset from end of queue service tree for idle class |
| 42 | */ | 42 | */ |
| 43 | #define CFQ_IDLE_DELAY (NSEC_PER_SEC / 5) | 43 | #define CFQ_IDLE_DELAY (NSEC_PER_SEC / 5) |
| 44 | /* offset from end of group service tree under time slice mode */ | ||
| 45 | #define CFQ_SLICE_MODE_GROUP_DELAY (NSEC_PER_SEC / 5) | ||
| 46 | /* offset from end of group service under IOPS mode */ | ||
| 47 | #define CFQ_IOPS_MODE_GROUP_DELAY (HZ / 5) | ||
| 44 | 48 | ||
| 45 | /* | 49 | /* |
| 46 | * below this threshold, we consider thinktime immediate | 50 | * below this threshold, we consider thinktime immediate |
| @@ -1362,6 +1366,14 @@ cfq_group_service_tree_add(struct cfq_rb_root *st, struct cfq_group *cfqg) | |||
| 1362 | cfqg->vfraction = max_t(unsigned, vfr, 1); | 1366 | cfqg->vfraction = max_t(unsigned, vfr, 1); |
| 1363 | } | 1367 | } |
| 1364 | 1368 | ||
| 1369 | static inline u64 cfq_get_cfqg_vdisktime_delay(struct cfq_data *cfqd) | ||
| 1370 | { | ||
| 1371 | if (!iops_mode(cfqd)) | ||
| 1372 | return CFQ_SLICE_MODE_GROUP_DELAY; | ||
| 1373 | else | ||
| 1374 | return CFQ_IOPS_MODE_GROUP_DELAY; | ||
| 1375 | } | ||
| 1376 | |||
| 1365 | static void | 1377 | static void |
| 1366 | cfq_group_notify_queue_add(struct cfq_data *cfqd, struct cfq_group *cfqg) | 1378 | cfq_group_notify_queue_add(struct cfq_data *cfqd, struct cfq_group *cfqg) |
| 1367 | { | 1379 | { |
| @@ -1381,7 +1393,8 @@ cfq_group_notify_queue_add(struct cfq_data *cfqd, struct cfq_group *cfqg) | |||
| 1381 | n = rb_last(&st->rb); | 1393 | n = rb_last(&st->rb); |
| 1382 | if (n) { | 1394 | if (n) { |
| 1383 | __cfqg = rb_entry_cfqg(n); | 1395 | __cfqg = rb_entry_cfqg(n); |
| 1384 | cfqg->vdisktime = __cfqg->vdisktime + CFQ_IDLE_DELAY; | 1396 | cfqg->vdisktime = __cfqg->vdisktime + |
| 1397 | cfq_get_cfqg_vdisktime_delay(cfqd); | ||
| 1385 | } else | 1398 | } else |
| 1386 | cfqg->vdisktime = st->min_vdisktime; | 1399 | cfqg->vdisktime = st->min_vdisktime; |
| 1387 | cfq_group_service_tree_add(st, cfqg); | 1400 | cfq_group_service_tree_add(st, cfqg); |
