Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1458204

Re: [RFD] I/O scheduling in blk-mq

Path csiph.com!news.mixmin.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod
From Omar Sandoval <osandov@osandov.com>
Newsgroups linux.kernel
Subject Re: [RFD] I/O scheduling in blk-mq
Date Mon, 08 Aug 2016 22:10:02 +0200
Message-ID <s3Z22-63f-5@gated-at.bofh.it> (permalink)
References <s3Tzk-2sm-5@gated-at.bofh.it>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=8KUQqzhvCgiXHHIvqwUcHjUSZDmcpyOmegNRKk9OQgc=; b=KF5XtBYq6Ll74ZQy3fBJznn57x5Al46RofP5q+yLIcOWNljnDKeexcMugIdrBjbiDY +0J4xw4r8AvWrDgORI+Ff8rL3N/kGau7pgaPP44cZcOOuN56fkLQgGPt57Dag4pe4jf8 Sw8Raej06OpVe2SH5m6rx6Kh00tYQofUXI55Q4Z1U9d/ARGxo7qFcO5GPXeTK5vxR1n4 0vRtVc78fOf7jUr07Aw3XrqR4lMEZmrAmRxwVisyzSe3UlMU0tbcEoIMtjTwP01sNz3y orfTT/SIrh3SLZnsdmR3akUoWOL+dxDQiEOWp4yObNCqbCaO7Kg4vz7mFVOeewiQinoi q5Yw==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=8KUQqzhvCgiXHHIvqwUcHjUSZDmcpyOmegNRKk9OQgc=; b=O2DwR+1ifznA0Aq0/XfMAyDLwlmH/Y+Pr8w+6v0tLUZmNvazvrrb/eVbm2HK+/zrZ0 vdoVRGnwuh0/MTrH/EMPCSzdrBmFp6rVz7ukWBd5q82fkngtYPaHqO+ZCcfkYi4QaY8F IvEqbGg8O6DFV7cFIlFFympMG3rnNzwrsAYfU9Ph+bNg1hKUqoYo0XUL2wY4WAnpECqa D3dNB/S0Lpwlbi2ENhJQZ9mOrRxfwb2IHXOSm0tz9wNG4rRuFa0pYh/elw0MCNuXsZ8O YKif8SuxbSDxxJn7L0A8wiuL31cCVgG2n6nGlhHp/Z7nTBua4QaU/ayypdM0Th1yuQSC tkkA==
X-Gm-Message-State AEkoousV87PMY1cWTLxwMmmmQscuZ7DAHT8WIdOOTVzVnPfJpxrg2HV2atDiQybG+6tNGGXd
X-Received by 10.98.100.67 with SMTP id y64mr165789890pfb.84.1470686945838; Mon, 08 Aug 2016 13:09:05 -0700 (PDT)
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.6.2 (2016-07-01)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 68
Organization linux.* mail to news gateway
X-Original-Cc Jens Axboe <axboe@kernel.dk>, Tejun Heo <tj@kernel.org>, Christoph Hellwig <hch@infradead.org>, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Ulf Hansson <ulf.hansson@linaro.org>, Linus Walleij <linus.walleij@linaro.org>, broonie@kernel.org
X-Original-Date Mon, 8 Aug 2016 13:09:03 -0700
X-Original-Message-ID <20160808200903.GA16275@vader.DHCP.thefacebook.com>
X-Original-References <42e6f39b-7b47-963f-69b8-2cf61e889339@linaro.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1458204

Show key headers only | View raw


On Mon, Aug 08, 2016 at 04:09:56PM +0200, Paolo wrote:
> Hi Jens, Tejun, Christoph, all,
> AFAIK blk-mq does not yet feature I/O schedulers. In particular, there
> is no scheduler providing strong guarantees in terms of
> responsiveness, latency for time-sensitive applications and bandwidth
> distribution.
> 
> For this reason, I'm trying to port BFQ to blk-mq, or to develop
> something simpler if even a reduced version of BFQ proves to be too
> heavy (this project is supported by Linaro). If you are willing to
> provide some feedback in this respect, I would like to ask for
> opinions/suggestions on the following two matters, and possibly to
> open a more general discussion on I/O scheduling in blk-mq.
> 
> 1) My idea is to have an independent instance of BFQ, or in general of
> the I/O scheduler, executed for each software queue. Then there would
> be no global scheduling. The drawback of no global scheduling is that
> each process cannot get more than 1/M of the total throughput of the
> device, if M is the number of software queues. But, if I'm not
> mistaken, it is however unfeasible to give a process more than 1/M of
> the total throughput, without lowering the throughput itself. In fact,
> giving a process more than 1/M of the total throughput implies serving
> its software queue, say Q, more than the others.  The only way to do
> it is periodically stopping the service of the other software queues
> and dispatching only the requests in Q. But this would reduce
> parallelism, which is the main way how blk-mq achieves a very high
> throughput. Are these considerations, and, in particular, one
> independent I/O scheduler per software queue, sensible?
> 
> 2) To provide per-process service guarantees, an I/O scheduler must
> create per-process internal queues. BFQ and CFQ use I/O contexts to
> achieve this goal. Is something like that (or exactly the same)
> available also in blk-mq? If so, do you have any suggestion, or link to
> documentation/code on how to use what is available in blk-mq?
> 
> Thanks,
> Paolo

Hi, Paolo,

I've been working on I/O scheduling for blk-mq with Jens for the past
few months (splitting time with other small projects), and we're making
good progress. Like you noticed, the hard part isn't really grafting a
scheduler interface onto blk-mq, it's maintaining good scalability while
providing adequate fairness.

We're working towards a scheduler more like deadline and getting the
architectural issues worked out. The goal is some sort of fairness
across all queues. The scheduler-per-software-queue model won't hold up
so well if we have a slower device with an I/O-hungry process on one CPU
and an interactive process on another CPU.

The issue I'm working through now is that on blk-mq, we only have as
many `struct request`s as the hardware has tags, so on a device with a
limited queue depth, it's really hard to do any sort of intelligent
scheduling. The solution for that is switching over to working with
`struct bio`s in the software queues instead, which abstracts away the
hardware capabilities. I have some work in progress at
https://github.com/osandov/linux/tree/blk-mq-iosched, but it's not yet
at feature-parity.

After that, I'll be back to working on the scheduling itself. The vague
idea is to amortize global scheduling decisions, but I don't have much
concrete code behind that yet.

Thanks!
-- 
Omar

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[RFD] I/O scheduling in blk-mq Paolo <paolo.valente@linaro.org> - 2016-08-08 16:20 +0200
  Re: [RFD] I/O scheduling in blk-mq Bart Van Assche <bvanassche@acm.org> - 2016-08-08 18:40 +0200
  Re: [RFD] I/O scheduling in blk-mq Omar Sandoval <osandov@osandov.com> - 2016-08-08 22:10 +0200

csiph-web