Re: IO scheduler based IO controller V10

From: Corrado Zoccolo
Date: Tue Sep 29 2009 - 03:14:54 EST


Hi Mike,
On Mon, Sep 28, 2009 at 8:53 PM, Mike Galbraith <efault@xxxxxx> wrote:
> On Mon, 2009-09-28 at 14:18 -0400, Vivek Goyal wrote:
>> On Mon, Sep 28, 2009 at 07:51:14PM +0200, Mike Galbraith wrote:
>
>> I guess changing class to IDLE should have helped a bit as now this is
>> equivalent to setting the quantum to 1 and after dispatching one request
>> to disk, CFQ will always expire the writer once. So it might happen that
>> by the the reader preempted writer, we have less number of requests in
>> disk and lesser latency for this reader.
>
> I expected SCHED_IDLE to be better than setting quantum to 1, because
> max is quantum*4 if you aren't IDLE. ÂBut that's not what happened. ÂI
> just retested with all knobs set back to stock, fairness off, and
> quantum set to 1 with everything running nice 0. Â2.8 seconds avg :-/

Idle doesn't work very well for async writes, since the writer process
will just send its writes to the page cache.
The real writeback will happen in the context of a kernel thread, with
best effort scheduling class.

>
>> > I saw
>> > the reference to Vivek's patch, and gave it a shot. ÂMakes a large
>> > difference.
>> > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ÂAvg
>> > perf stat   12.82   7.19   8.49   5.76   9.32  Â8.7   anticipatory
>> > Â Â Â Â Â Â Â 16.24 Â 175.82 Â 154.38 Â 228.97 Â 147.16 Â144.5 Â Â noop
>> > Â Â Â Â Â Â Â 43.23 Â Â57.39 Â Â96.13 Â 148.25 Â 180.09 Â105.0 Â Â deadline
>> > Â Â Â Â Â Â Â Â9.15 Â Â14.51 Â Â 9.39 Â Â15.06 Â Â 9.90 Â 11.6 Â Â cfq fairness=0 dd=nice 0
>> > Â Â Â Â Â Â Â 12.22 Â Â 9.85 Â Â12.55 Â Â 9.88 Â Â15.06 Â 11.9 Â Â cfq fairness=0 dd=nice 19
>> > Â Â Â Â Â Â Â Â9.77 Â Â13.19 Â Â11.78 Â Â17.40 Â Â 9.51 Â 11.9 Â Â cfq fairness=0 dd=SCHED_IDLE
>> > Â Â Â Â Â Â Â Â4.59 Â Â 2.74 Â Â 4.70 Â Â 3.45 Â Â 4.69 Â Â4.0 Â Â cfq fairness=1 dd=nice 0
>> > Â Â Â Â Â Â Â Â3.79 Â Â 4.66 Â Â 2.66 Â Â 5.15 Â Â 3.03 Â Â3.8 Â Â cfq fairness=1 dd=nice 19
>> > Â Â Â Â Â Â Â Â2.79 Â Â 4.73 Â Â 2.79 Â Â 4.02 Â Â 2.50 Â Â3.3 Â Â cfq fairness=1 dd=SCHED_IDLE
>> >
>>
>> Hmm.., looks like average latency went down only in Âcase of fairness=1
>> and not in case of fairness=0. (Looking at previous mail, average vanilla
>> cfq latencies were around 12 seconds).
>
> Yup.
>
>> Are you running all this in root group or have you put writers and readers
>> into separate cgroups?
>
> No cgroups here.
>
>> If everything is running in root group, then I am curious why latency went
>> down in case of fairness=1. The only thing fairness=1 parameter does is
>> that it lets complete all the requests from previous queue before start
>> dispatching from next queue. On top of this is valid only if no preemption
>> took place. In your test case, konsole should preempt the writer so
>> practically fairness=1 might not make much difference.
>
> fairness=1 very definitely makes a very large difference. ÂAll of those
> cfq numbers were logged in back to back runs.
>
>> In fact now Jens has committed a patch which achieves the similar effect as
>> fairness=1 for async queues.
>
> Yeah, I was there yesterday. ÂI speculated that that would hurt my
> reader, but rearranging things didn't help one bit. ÂPlaying with merge,
> I managed to give dd ~7% more throughput, and injured poor reader even
> more. Â(problem analysis via hammer/axe not always most effective;)
>
>> commit 5ad531db6e0f3c3c985666e83d3c1c4d53acccf9
>> Author: Jens Axboe <jens.axboe@xxxxxxxxxx>
>> Date: Â Fri Jul 3 12:57:48 2009 +0200
>>
>> Â Â cfq-iosched: drain device queue before switching to a sync queue
>>
>> Â Â To lessen the impact of async IO on sync IO, let the device drain of
>> Â Â any async IO in progress when switching to a sync cfqq that has idling
>> Â Â enabled.
>>
>>
>> If everything is in separate cgroups, then we should have seen latency
>> improvements in case of fairness=0 case also. I am little perplexed here..
>>
>> Thanks
>> Vivek
>
>

Thanks,
Corrado


--
__________________________________________________________________________

dott. Corrado Zoccolo mailto:czoccolo@xxxxxxxxx
PhD - Department of Computer Science - University of Pisa, Italy
--------------------------------------------------------------------------
The self-confidence of a warrior is not the self-confidence of the average
man. The average man seeks certainty in the eyes of the onlooker and calls
that self-confidence. The warrior seeks impeccability in his own eyes and
calls that humbleness.
Tales of Power - C. Castaneda
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/