Re: [patch v2 8/8]block: fiops sync preempts async

From: Hillf Danton
Date: Mon Jan 30 2012 - 06:53:41 EST


Hello Shaohua

On Mon, Jan 30, 2012 at 3:02 PM, Shaohua Li <shaohua.li@xxxxxxxxx> wrote:
> Debug patch only.
>
> This implements CFQ like sync preempts async. But like CFQ, this
> will starve async.
>
> ---
> Âblock/fiops-iosched.c | Â 15 +++++++++++++++
> Â1 file changed, 15 insertions(+)
>
> Index: linux/block/fiops-iosched.c
> ===================================================================
> --- linux.orig/block/fiops-iosched.c  Â2012-01-21 10:35:04.000000000 +0800
> +++ linux/block/fiops-iosched.c 2012-01-21 10:48:52.000000000 +0800
> @@ -408,6 +408,21 @@ static struct fiops_ioc *fiops_select_io
> Â Â Â Â Â Â Â Âreturn NULL;
> Â Â Â Â}
>
> + Â Â Â /* Let sync request preempt async queue */
> + Â Â Â if (!rq_is_sync(rq) && service_tree->count > 1) {
> + Â Â Â Â Â Â Â struct rb_node *tmp = rb_next(&ioc->rb_node);
> + Â Â Â Â Â Â Â struct fiops_ioc *sync_ioc = NULL;
> + Â Â Â Â Â Â Â while (tmp) {
> + Â Â Â Â Â Â Â Â Â Â Â sync_ioc = rb_entry(tmp, struct fiops_ioc, rb_node);
> + Â Â Â Â Â Â Â Â Â Â Â rq = rq_entry_fifo(sync_ioc->fifo.next);
> + Â Â Â Â Â Â Â Â Â Â Â if (rq_is_sync(rq))
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â break;
> + Â Â Â Â Â Â Â Â Â Â Â tmp = rb_next(&sync_ioc->rb_node);

sync_ioc = NULL; yes?
Hillf
> + Â Â Â Â Â Â Â }
> + Â Â Â Â Â Â Â if (sync_ioc)
> + Â Â Â Â Â Â Â Â Â Â Â ioc = sync_ioc;
> + Â Â Â }
> +
> Â Â Â Âreturn ioc;
> Â}
>
N‹§²æìr¸›yúèšØb²X¬¶ÇvØ^–)Þ{.nÇ+‰·¥Š{±‘êçzX§¶›¡Ü}©ž²ÆzÚ&j:+v‰¨¾«‘êçzZ+€Ê+zf£¢·hšˆ§~†­†Ûiÿûàz¹®w¥¢¸?™¨è­Ú&¢)ßf”ù^jÇy§m…á@A«a¶Úÿ 0¶ìh®å’i