Messages in this thread | | | Date | Mon, 30 Jan 2012 19:53:41 +0800 | Subject | Re: [patch v2 8/8]block: fiops sync preempts async | From | Hillf Danton <> |
| |
Hello Shaohua
On Mon, Jan 30, 2012 at 3:02 PM, Shaohua Li <shaohua.li@intel.com> 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; > } >
| |