diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2009-10-02 13:27:04 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-10-02 14:06:02 -0400 |
commit | 1d2235152dc745c6d94bedb550fea84cffdbf768 (patch) | |
tree | eb489f01dd6d506c1b785bae03e68e42145a055b /block/cfq-iosched.c | |
parent | b0da3f0dada78832c9da03ad2152ae76bd9a2496 (diff) |
cfq-iosched: add a knob for desktop interactiveness
This is basically identical to what Vivek Goyal posted, but combined
into one and labelled 'desktop' instead of 'fairness'. The goal
is to continue to improve on the latency side of things as it relates
to interactiveness, keeping the questionable bits under this sysfs
tunable so it would be easy for throughput-only people to turn off.
Apart from adding the interactive sysfs knob, it also adds the
behavioural change of allowing slice idling even if the hardware
does tagged command queuing.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/cfq-iosched.c')
-rw-r--r-- | block/cfq-iosched.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 1ca813b16e78..8917f2b3a783 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
@@ -173,6 +173,7 @@ struct cfq_data { | |||
173 | unsigned int cfq_slice[2]; | 173 | unsigned int cfq_slice[2]; |
174 | unsigned int cfq_slice_async_rq; | 174 | unsigned int cfq_slice_async_rq; |
175 | unsigned int cfq_slice_idle; | 175 | unsigned int cfq_slice_idle; |
176 | unsigned int cfq_desktop; | ||
176 | 177 | ||
177 | struct list_head cic_list; | 178 | struct list_head cic_list; |
178 | 179 | ||
@@ -1951,7 +1952,7 @@ cfq_update_idle_window(struct cfq_data *cfqd, struct cfq_queue *cfqq, | |||
1951 | enable_idle = old_idle = cfq_cfqq_idle_window(cfqq); | 1952 | enable_idle = old_idle = cfq_cfqq_idle_window(cfqq); |
1952 | 1953 | ||
1953 | if (!atomic_read(&cic->ioc->nr_tasks) || !cfqd->cfq_slice_idle || | 1954 | if (!atomic_read(&cic->ioc->nr_tasks) || !cfqd->cfq_slice_idle || |
1954 | (cfqd->hw_tag && CIC_SEEKY(cic))) | 1955 | (!cfqd->cfq_desktop && cfqd->hw_tag && CIC_SEEKY(cic))) |
1955 | enable_idle = 0; | 1956 | enable_idle = 0; |
1956 | else if (sample_valid(cic->ttime_samples)) { | 1957 | else if (sample_valid(cic->ttime_samples)) { |
1957 | if (cic->ttime_mean > cfqd->cfq_slice_idle) | 1958 | if (cic->ttime_mean > cfqd->cfq_slice_idle) |
@@ -2480,6 +2481,7 @@ static void *cfq_init_queue(struct request_queue *q) | |||
2480 | cfqd->cfq_slice[1] = cfq_slice_sync; | 2481 | cfqd->cfq_slice[1] = cfq_slice_sync; |
2481 | cfqd->cfq_slice_async_rq = cfq_slice_async_rq; | 2482 | cfqd->cfq_slice_async_rq = cfq_slice_async_rq; |
2482 | cfqd->cfq_slice_idle = cfq_slice_idle; | 2483 | cfqd->cfq_slice_idle = cfq_slice_idle; |
2484 | cfqd->cfq_desktop = 1; | ||
2483 | cfqd->hw_tag = 1; | 2485 | cfqd->hw_tag = 1; |
2484 | 2486 | ||
2485 | return cfqd; | 2487 | return cfqd; |
@@ -2549,6 +2551,7 @@ SHOW_FUNCTION(cfq_slice_idle_show, cfqd->cfq_slice_idle, 1); | |||
2549 | SHOW_FUNCTION(cfq_slice_sync_show, cfqd->cfq_slice[1], 1); | 2551 | SHOW_FUNCTION(cfq_slice_sync_show, cfqd->cfq_slice[1], 1); |
2550 | SHOW_FUNCTION(cfq_slice_async_show, cfqd->cfq_slice[0], 1); | 2552 | SHOW_FUNCTION(cfq_slice_async_show, cfqd->cfq_slice[0], 1); |
2551 | SHOW_FUNCTION(cfq_slice_async_rq_show, cfqd->cfq_slice_async_rq, 0); | 2553 | SHOW_FUNCTION(cfq_slice_async_rq_show, cfqd->cfq_slice_async_rq, 0); |
2554 | SHOW_FUNCTION(cfq_desktop_show, cfqd->cfq_desktop, 0); | ||
2552 | #undef SHOW_FUNCTION | 2555 | #undef SHOW_FUNCTION |
2553 | 2556 | ||
2554 | #define STORE_FUNCTION(__FUNC, __PTR, MIN, MAX, __CONV) \ | 2557 | #define STORE_FUNCTION(__FUNC, __PTR, MIN, MAX, __CONV) \ |
@@ -2580,6 +2583,7 @@ STORE_FUNCTION(cfq_slice_sync_store, &cfqd->cfq_slice[1], 1, UINT_MAX, 1); | |||
2580 | STORE_FUNCTION(cfq_slice_async_store, &cfqd->cfq_slice[0], 1, UINT_MAX, 1); | 2583 | STORE_FUNCTION(cfq_slice_async_store, &cfqd->cfq_slice[0], 1, UINT_MAX, 1); |
2581 | STORE_FUNCTION(cfq_slice_async_rq_store, &cfqd->cfq_slice_async_rq, 1, | 2584 | STORE_FUNCTION(cfq_slice_async_rq_store, &cfqd->cfq_slice_async_rq, 1, |
2582 | UINT_MAX, 0); | 2585 | UINT_MAX, 0); |
2586 | STORE_FUNCTION(cfq_desktop_store, &cfqd->cfq_desktop, 0, 1, 0); | ||
2583 | #undef STORE_FUNCTION | 2587 | #undef STORE_FUNCTION |
2584 | 2588 | ||
2585 | #define CFQ_ATTR(name) \ | 2589 | #define CFQ_ATTR(name) \ |
@@ -2595,6 +2599,7 @@ static struct elv_fs_entry cfq_attrs[] = { | |||
2595 | CFQ_ATTR(slice_async), | 2599 | CFQ_ATTR(slice_async), |
2596 | CFQ_ATTR(slice_async_rq), | 2600 | CFQ_ATTR(slice_async_rq), |
2597 | CFQ_ATTR(slice_idle), | 2601 | CFQ_ATTR(slice_idle), |
2602 | CFQ_ATTR(desktop), | ||
2598 | __ATTR_NULL | 2603 | __ATTR_NULL |
2599 | }; | 2604 | }; |
2600 | 2605 | ||