Re: [PATCH 1/2] blk-throtl: make latency= absolute

From: Shaohua Li
Date: Sun Nov 12 2017 - 23:29:49 EST


On Fri, Nov 10, 2017 at 07:43:14AM -0800, Tejun Heo wrote:
> Hello, Shaohua.
>
> On Thu, Nov 09, 2017 at 08:27:13PM -0800, Shaohua Li wrote:
> > I think the absolute latency would only work for HD. For a SSD, a 4k latency
> > probably is 60us and 1M latency is 500us. The disk must be very contended to
> > make 4k latency reach 500us. Not sensitive doesn't mean no protection. If the
> > use case sets rough latency, say 1ms, there will be no protection for 4k IO at
> > all. The baseline latency is pretty reliable for SSD actually. So I'd rather
>
> I don't understand how that would mean no protection. The latency
> naturally includes the queueing time on the host side and, even for a
> fast SSD device, it isn't too difficult to saturate the device to the
> point where the host-side waiting time becomes pretty long. All
> that's necessary is IOs being issued faster than completed and we can
> almost always do that.

Didn't get this. What did you mean 'queueing time on the host side'? You mean
the application think time delay?

My point is absolute latency doen't protect as we expected. Let me have an
example. Say 4k latency is 60us, BW is 100MB/s. When 4k BW is 50MB/s, the
latency is 200us. 1M latency is 500us. If you set the absolute latency to
600us, you can't protect the 4k BW to above 50MB/s. To do the protection, you
really want to set the absolute latency below 500us, which doesn't work for the
1M IO.

> > keeping the baseline latency for SSD but using absolute latency for HD, which
> > can be done easily by setting DFL_HD_BASELINE_LATENCY to 0.
>
> I don't think that'd be a good interface choice. It's too misleading.
> If we actually need to specify baseline + margin, it'd probably be
> better to add another notation - say, "+N" - than overloading the
> meaning of "N".

We don't overload the meaning of "N". Untill your next patch, the "N" actually
means "+N".

Ponder a little bit, I think 4ms base latency for HD actually is reasonable. We
have LATENCY_FILTERED_HD to filter out small latency bios, which come from
sequential IO. So remaining IO is random IO. 4k base latency for HD random IO
should be ok. Probably something else is wrong. I think we need understand
what's wrong for HD throttling first before we make any change.

Thanks,
Shaohua