linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch]cfq-iosched: don't idle if a deep seek queue is slow
@ 2010-09-20  8:53 Shaohua Li
  2010-09-20 14:15 ` Vivek Goyal
  0 siblings, 1 reply; 3+ messages in thread
From: Shaohua Li @ 2010-09-20  8:53 UTC (permalink / raw)
  To: lkml; +Cc: jaxboe, vgoyal, czoccolo

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>

---
 block/cfq-iosched.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

Index: linux-2.6/block/cfq-iosched.c
===================================================================
--- linux-2.6.orig/block/cfq-iosched.c	2010-09-19 21:25:11.000000000 +0800
+++ linux-2.6/block/cfq-iosched.c	2010-09-21 00:20:46.000000000 +0800
@@ -2275,6 +2275,17 @@
 		goto keep_queue;
 	}
 
+	/*
+	 * This is a deep seek queue, but the device is much faster than
+	 * the queue can deliver, don't idle
+	 **/
+	if (CFQQ_SEEKY(cfqq) && cfq_cfqq_idle_window(cfqq) &&
+	    (cfq_cfqq_slice_new(cfqq) ||
+	    (cfqq->slice_end - jiffies > jiffies - cfqq->slice_start))) {
+		cfq_clear_cfqq_deep(cfqq);
+		cfq_clear_cfqq_idle_window(cfqq);
+	}
+
 	if (cfqq->dispatched && cfq_should_idle(cfqd, cfqq)) {
 		cfqq = NULL;
 		goto keep_queue;



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch]cfq-iosched: don't idle if a deep seek queue is slow
  2010-09-20  8:53 [patch]cfq-iosched: don't idle if a deep seek queue is slow Shaohua Li
@ 2010-09-20 14:15 ` Vivek Goyal
  2010-09-20 23:55   ` Shaohua Li
  0 siblings, 1 reply; 3+ messages in thread
From: Vivek Goyal @ 2010-09-20 14:15 UTC (permalink / raw)
  To: Shaohua Li; +Cc: lkml, jaxboe, czoccolo

On Mon, Sep 20, 2010 at 04:53:34PM +0800, Shaohua Li wrote:
> 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.
> 

Hi Shaohua,

So you seem to be addressing the issue of storage being fast enough and
a single queue not being able to keep the storage busy.

But we have the same issue for non-deep queues for a fast storage. This
patch will not solve that.

I think CFQ idling in general is a problem on faster storage. For SSDs we
can statically detect non-rotational media and disable idling. For faster
RAIDs we need to find an intellligent way of detection and disable idling.

One of the suggestions at this year's LSF was to keep idling on only for
SATA disks and for any SCSI disks we can think of disabling idling by
default. May be with the help of udev rule.

Thanks
Vivek

> Signed-off-by: Shaohua Li <shaohua.li@intel.com>
> 
> ---
>  block/cfq-iosched.c |   11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> Index: linux-2.6/block/cfq-iosched.c
> ===================================================================
> --- linux-2.6.orig/block/cfq-iosched.c	2010-09-19 21:25:11.000000000 +0800
> +++ linux-2.6/block/cfq-iosched.c	2010-09-21 00:20:46.000000000 +0800
> @@ -2275,6 +2275,17 @@
>  		goto keep_queue;
>  	}
>  
> +	/*
> +	 * This is a deep seek queue, but the device is much faster than
> +	 * the queue can deliver, don't idle
> +	 **/
> +	if (CFQQ_SEEKY(cfqq) && cfq_cfqq_idle_window(cfqq) &&
> +	    (cfq_cfqq_slice_new(cfqq) ||
> +	    (cfqq->slice_end - jiffies > jiffies - cfqq->slice_start))) {
> +		cfq_clear_cfqq_deep(cfqq);
> +		cfq_clear_cfqq_idle_window(cfqq);
> +	}
> +
>  	if (cfqq->dispatched && cfq_should_idle(cfqd, cfqq)) {
>  		cfqq = NULL;
>  		goto keep_queue;
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch]cfq-iosched: don't idle if a deep seek queue is slow
  2010-09-20 14:15 ` Vivek Goyal
@ 2010-09-20 23:55   ` Shaohua Li
  0 siblings, 0 replies; 3+ messages in thread
From: Shaohua Li @ 2010-09-20 23:55 UTC (permalink / raw)
  To: Vivek Goyal; +Cc: lkml, jaxboe@fusionio.com, czoccolo@gmail.com

On Mon, 2010-09-20 at 22:15 +0800, Vivek Goyal wrote:
> On Mon, Sep 20, 2010 at 04:53:34PM +0800, Shaohua Li wrote:
> > 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.
> > 
> 
> Hi Shaohua,
> 
> So you seem to be addressing the issue of storage being fast enough and
> a single queue not being able to keep the storage busy.
> 
> But we have the same issue for non-deep queues for a fast storage. This
> patch will not solve that.
right.

> I think CFQ idling in general is a problem on faster storage. For SSDs we
> can statically detect non-rotational media and disable idling. For faster
> RAIDs we need to find an intellligent way of detection and disable idling.
> 
> One of the suggestions at this year's LSF was to keep idling on only for
> SATA disks and for any SCSI disks we can think of disabling idling by
> default. May be with the help of udev rule.
That makes sense, but shouldn't kernel has some reasonable setting?
completely depending on userspace isn't reliable.

Thanks,
Shaohua


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-09-20 23:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-20  8:53 [patch]cfq-iosched: don't idle if a deep seek queue is slow Shaohua Li
2010-09-20 14:15 ` Vivek Goyal
2010-09-20 23:55   ` Shaohua Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).