Commit 8e1ac6655104bc6e1e79d67e2df88cc8fa9b6e07

Authored by Shaohua Li
Committed by Jens Axboe
1 parent d2d59e18a1

cfq-iosched: don't idle if a deep seek queue is slow

If a deep seek queue slowly deliver requests but disk is much faster, idle
for the queue just wastes disk throughput. If the queue delevers all requests
before half its slice is used, the patch disable idle for it.
In my test, application delivers 32 requests one time, the disk can accept
128 requests at maxium and disk is fast. without the patch, the throughput
is just around 30m/s, while with it, the speed is about 80m/s. The disk is
a SSD, but is detected as a rotational disk. I can configure it as SSD, but
I thought the deep seek queue logic should be fixed too, for example,
considering a fast raid.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>

Showing 1 changed file with 11 additions and 0 deletions Side-by-side Diff

... ... @@ -2285,6 +2285,17 @@
2285 2285 goto keep_queue;
2286 2286 }
2287 2287  
  2288 + /*
  2289 + * This is a deep seek queue, but the device is much faster than
  2290 + * the queue can deliver, don't idle
  2291 + **/
  2292 + if (CFQQ_SEEKY(cfqq) && cfq_cfqq_idle_window(cfqq) &&
  2293 + (cfq_cfqq_slice_new(cfqq) ||
  2294 + (cfqq->slice_end - jiffies > jiffies - cfqq->slice_start))) {
  2295 + cfq_clear_cfqq_deep(cfqq);
  2296 + cfq_clear_cfqq_idle_window(cfqq);
  2297 + }
  2298 +
2288 2299 if (cfqq->dispatched && cfq_should_idle(cfqd, cfqq)) {
2289 2300 cfqq = NULL;
2290 2301 goto keep_queue;