Re: [PATCH 1/2] blk-throtl: make latency= absolute
From: Shaohua Li
Date: Mon Nov 13 2017 - 17:08:12 EST
On Mon, Nov 13, 2017 at 06:18:49AM -0800, Tejun Heo wrote:
> Hello, Shaohua. Just a bit of addition.
>
> On Mon, Nov 13, 2017 at 03:27:10AM -0800, Tejun Heo wrote:
> > What I'm trying to say is that the latency is defined as "from bio
> > issue to completion", not "in-flight time on device". Whether the
> > on-device latency is 50us or 500us, the host side queueing latency can
> > be in orders of magnitude higher.
> >
> > For things like starvation protection for managerial workloads which
> > work fine on rotating disks, the only thing we need to protect against
> > is excessive host side queue overflowing leading to starvation of such
> > workloads. IOW, we're talking about latency target in tens or lower
> > hundreds of millisecs. Whether the on-device time is 50 or 500us
> > doesn't matter that much.
>
> So, the absolute latency target can express the requirements of the
> workload in question - it's saying "if the IO latency stays within
> this boundary, regardless of the underlying device, this workload is
> gonna be happy enough". There are workloads which are this way -
> e.g. it has some IOs to do and some deadline requirements (like
> heartbeat period). For those workloads, it doesn't matter what the
> underlying device is. It can be a rotating disk, or a slow or
> lightening-fast SSD. As long as the absolute target latency is met,
> the workload will be happy.
I think this is what we don't agree with. The user doesn't really care about
the IO latency. What user care about is 'read' syscall latency or 'fsync'
syscall latency. The syscall could do several 4k IO or 1M IO or mixed. To meet
the syscall latency target, we must control the latency for each IO. If we use
absolute latency, it can only control some IOs. In this case, it's very likely
the syscall latency requirement isn't met. So we do need to know what the
underlying device is.
That said, absolute latency is useful for HD. But on the other hand, HD
baseline is always 4ms for any size IO. So absolute latency = 4ms + slack,
unless you want to specify a smaller than 4ms absolute latency.
Thanks,
Shaohua