Messages in this thread | | | Date | Tue, 15 Feb 2011 09:21:50 -0500 | From | Vivek Goyal <> | Subject | Re: [PATCH 3/6 v4] cfq-iosched: Introduce vdisktime and io weight for CFQ queue |
| |
On Tue, Feb 15, 2011 at 09:44:44AM +0800, Gui Jianfeng wrote:
[..] > >> +static inline u64 cfq_get_boost(struct cfq_data *cfqd, > >> + struct cfq_queue *cfqq) > >> +{ > >> + u64 d; > >> + > >> + if (cfq_cfqq_sync(cfqq)) > >> + d = CFQ_BOOST_SYNC_BASE << CFQ_SERVICE_SHIFT; > >> + else > >> + d = CFQ_BOOST_ASYNC_BASE << CFQ_SERVICE_SHIFT; > >> + > >> + d = d * BLKIO_WEIGHT_DEFAULT; > >> + do_div(d, cfqq->cfqe.weight); > >> + return d; > >> +} > > > > The logic for cfq_get_boost() looks a lot like cfq_scale_slice(). > > Instead of duplicating code, can't it just be > > u64 d; > > if (cfq_cfqq_sync(cfqq)) > > return cfq_scale_slice(CFQ_BOOST_SYNC_BASE, cfqq->cfqe); > > else > > return cfq_scale_slice(CFQ_BOOST_ASYNC_BASE, cfqq->cfqe); > >
I still think that we should use smaller values for CFQ_BOOST_SYNC_BASE because otherwise what it means is that for freshly backlogged queues we assume that these have already used one slice and then requeue these accordingly. Instead it should be reverse where freshly backlogged queues should get preference over already queues which are hogging the disk for long time.
Thanks Vivek
| |