linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Valente <paolo.valente@linaro.org>
To: Oleksandr Natalenko <oleksandr@natalenko.name>
Cc: Jens Axboe <axboe@kernel.dk>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Tejun Heo <tj@kernel.org>, Li Zefan <lizefan@huawei.com>,
	Angelo Ruocco <angeloruocco90@gmail.com>,
	Dennis Zhou <dennis@kernel.org>,
	Josef Bacik <josef@toxicpanda.com>,
	Liu Bo <bo.liu@linux.alibaba.com>,
	Bart Van Assche <bvanassche@acm.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	linux-block <linux-block@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Mark Brown <broonie@kernel.org>,
	'Paolo Valente' via bfq-iosched  <bfq-iosched@googlegroups.com>,
	cgroups@vger.kernel.org, linux-doc@vger.kernel.org,
	Jonathan Corbet <corbet@lwn.net>,
	lennart@poettering.net
Subject: Re: [PATCH 00/12] unify the interface of the proportional-share policy in blkio/io
Date: Mon, 12 Nov 2018 11:17:22 +0100	[thread overview]
Message-ID: <E8A20452-A73C-4A31-B5EC-48EFB9937832@linaro.org> (raw)
In-Reply-To: <9e8adb3271680165d85994a225713391@natalenko.name>



> Il giorno 12 nov 2018, alle ore 11:00, Oleksandr Natalenko <oleksandr@natalenko.name> ha scritto:
> 
> On 12.11.2018 10:56, Paolo Valente wrote:
>> Hi Jens, Tejun, all,
>> about nine months ago, we agreed on a solution for unifying the
>> interface of the proportional-share policy in blkio/io [1].  Angelo
>> and I finally completed it.  Let me briefly recall the problem and the
>> solution.
>> The current implementation of cgroups doesn't allow two or more
>> entities, e.g., I/O schedulers, to share the same files.  So, if CFQ
>> creates its files for the proportional-share policy, such as, e.g,
>> weight files for blkio/io groups, BFQ cannot attach somehow to them.
>> Thus, to enable people to set group weights with BFQ, I resorted to
>> making BFQ create its own version of these common files, by prepending
>> a bfq prefix.
>> Actually, no legacy code uses these different names, or is likely to
>> do so.  Having these two sets of names is simply a source of
>> confusion, as pointed out also, e.g., by Lennart Poettering (CCed
>> here), and acknowledged by Tejun [2].
>> In [1] we agreed on a solution that solves this problem, by actually
>> making it possible to share cgroups files.  Both writing to and
>> reading from a shared file trigger the appropriate operation for each
>> of the entities that share the file.  In particular, in case of
>> reading,
>> - if all entities produce the same output, the this common output is
>>  shown only once;
>> - if the outputs differ, then every per-entity output is shown,
>>  preceded by the name of the entity that produced that output.
>> With this solution, legacy code that, e.g., sets group weights, just
>> works, regardless of the I/O scheduler actually implementing
>> proportional share.
>> But note that this extension is not restricted to only blkio/io.  The
>> general group interface now enables files to be shared among multiple
>> entities of any kind.
>> (I have also added a patch to fix some clerical errors in bfq doc,
>> which I found while making the latter consistent with the new
>> interface.)
>> Thanks,
>> Paolo
>> [1] https://lkml.org/lkml/2018/1/4/667
>> [2] https://github.com/systemd/systemd/issues/7057
>> Angelo Ruocco (7):
>>  kernfs: add function to find kernfs_node without increasing ref
>>    counter
>>  cgroup: link cftypes of the same subsystem with the same name
>>  cgroup: add owner name to cftypes
>>  block, bfq: align min and default weights with cfq
>>  cgroup: make all functions of all cftypes be invoked
>>  block, cfq: allow cgroup files to be shared
>>  block, throttle: allow sharing cgroup statistic files
>> Paolo Valente (5):
>>  cgroup: add hook seq_show_cft with also the owning cftype as parameter
>>  block, cgroup: pass cftype to functions that need to use it
>>  block, bfq: use standard file names for the proportional-share policy
>>  doc, bfq-iosched: fix a few clerical errors
>>  doc, bfq-iosched: make it consistent with the new cgroup interface
>> Documentation/block/bfq-iosched.txt |  31 +++--
>> block/bfq-cgroup.c                  | 148 +++++++++++++-------
>> block/bfq-iosched.h                 |   4 +-
>> block/blk-cgroup.c                  |  22 +--
>> block/blk-throttle.c                |  24 ++--
>> block/cfq-iosched.c                 | 105 +++++++++++----
>> fs/kernfs/dir.c                     |  13 ++
>> include/linux/blk-cgroup.h          |  10 +-
>> include/linux/cgroup-defs.h         |  14 +-
>> include/linux/cgroup.h              |  13 ++
>> include/linux/kernfs.h              |   7 +
>> kernel/cgroup/cgroup.c              | 262 +++++++++++++++++++++++++++++-------
>> 12 files changed, 483 insertions(+), 170 deletions(-)
>> --
>> 2.16.1
> 
> I thought all the legacy stuff including CFS et al. is going to be removed in v4.21 completely…
> 

Thanks for pointing this out.

People with a lower kernel version than the future 4.21 just cannot
and will not be able to use the proportional share policy on blk-mq
(with legacy code), because of the name issue highlighted in this
email.  If this patch series gets accepted, a backport will solve the
problem.  In this respect, such a backport might even happen
'automatically', as most bfq commit seem to get backported to older,
stable kernels.

In addition, this extension
- extends the whole cgroups interface, in a seamless and
  backward-compatible way, to prevent future issues like these;
- solves a similar issue with throttle (which AFAIK won't go away
  with 4.21).

Thanks,
Paolo

> -- 
>  Oleksandr Natalenko (post-factum)


  parent reply	other threads:[~2018-11-12 10:17 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-12  9:56 [PATCH 00/12] unify the interface of the proportional-share policy in blkio/io Paolo Valente
2018-11-12  9:56 ` [PATCH 01/12] kernfs: add function to find kernfs_node without increasing ref counter Paolo Valente
2018-11-12 12:28   ` Greg Kroah-Hartman
2018-11-13  1:56     ` Matthew Wilcox
2018-11-13 17:53     ` Paolo Valente
2018-11-13 19:35       ` Greg Kroah-Hartman
2018-11-12  9:56 ` [PATCH 02/12] cgroup: add hook seq_show_cft with also the owning cftype as parameter Paolo Valente
2018-11-12  9:56 ` [PATCH 03/12] block, cgroup: pass cftype to functions that need to use it Paolo Valente
2018-11-12  9:56 ` [PATCH 04/12] cgroup: link cftypes of the same subsystem with the same name Paolo Valente
2018-11-12  9:56 ` [PATCH 05/12] cgroup: add owner name to cftypes Paolo Valente
2018-11-12  9:56 ` [PATCH 06/12] block, bfq: align min and default weights with cfq Paolo Valente
2018-11-12  9:56 ` [PATCH 07/12] cgroup: make all functions of all cftypes be invoked Paolo Valente
2018-11-12  9:56 ` [PATCH 08/12] block, cfq: allow cgroup files to be shared Paolo Valente
2018-11-12  9:56 ` [PATCH 09/12] block, bfq: use standard file names for the proportional-share policy Paolo Valente
2018-11-12  9:56 ` [PATCH 10/12] block, throttle: allow sharing cgroup statistic files Paolo Valente
2018-11-12  9:56 ` [PATCH 11/12] doc, bfq-iosched: fix a few clerical errors Paolo Valente
2018-11-12  9:56 ` [PATCH 12/12] doc, bfq-iosched: make it consistent with the new cgroup interface Paolo Valente
2018-11-12  9:58 ` [PATCH 00/12] unify the interface of the proportional-share policy in blkio/io Paolo Valente
2018-11-12 10:00 ` Oleksandr Natalenko
2018-11-12 10:14   ` Oleksandr Natalenko
2018-11-12 10:17   ` Paolo Valente [this message]
2018-11-12 15:35     ` Jens Axboe
2018-11-12 15:45       ` Paolo Valente
2018-11-12 15:48         ` Jens Axboe
2018-11-12 15:54           ` Josef Bacik
2018-11-12 16:05             ` Jens Axboe
2018-11-15 11:54       ` Angelo Ruocco
     [not found]         ` <CADiTV-3tSpEMG7EHz3XGvfekNdtN8k_KQiDMtyykgOb81cvO0g@mail.gmail.com>
2018-11-15 15:42           ` Oleksandr Natalenko
2018-11-15 16:30         ` Jens Axboe
2018-11-19  9:46           ` Angelo Ruocco

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E8A20452-A73C-4A31-B5EC-48EFB9937832@linaro.org \
    --to=paolo.valente@linaro.org \
    --cc=angeloruocco90@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=bfq-iosched@googlegroups.com \
    --cc=bo.liu@linux.alibaba.com \
    --cc=broonie@kernel.org \
    --cc=bvanassche@acm.org \
    --cc=cgroups@vger.kernel.org \
    --cc=corbet@lwn.net \
    --cc=dennis@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=josef@toxicpanda.com \
    --cc=lennart@poettering.net \
    --cc=linus.walleij@linaro.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=oleksandr@natalenko.name \
    --cc=tj@kernel.org \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).