linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Tejun Heo <tj@kernel.org>
Cc: Jan Kara <jack@suse.cz>, Dave Chinner <david@fromorbit.com>,
	Dan Schatzberg <schatzberg.dan@gmail.com>,
	Jens Axboe <axboe@kernel.dk>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Amir Goldstein <amir73il@gmail.com>,
	Li Zefan <lizefan@huawei.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Michal Hocko <mhocko@kernel.org>,
	Vladimir Davydov <vdavydov.dev@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Hugh Dickins <hughd@google.com>, Roman Gushchin <guro@fb.com>,
	Shakeel Butt <shakeelb@google.com>,
	Chris Down <chris@chrisdown.name>,
	Yang Shi <yang.shi@linux.alibaba.com>,
	Ingo Molnar <mingo@kernel.org>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	"open list:BLOCK LAYER" <linux-block@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:FILESYSTEMS (VFS and infrastructure)" 
	<linux-fsdevel@vger.kernel.org>,
	"open list:CONTROL GROUP (CGROUP)" <cgroups@vger.kernel.org>,
	"open list:CONTROL GROUP - MEMORY RESOURCE CONTROLLER (MEMCG)" 
	<linux-mm@kvack.org>
Subject: Re: [PATCH v5 0/4] Charge loop device i/o to issuing cgroup
Date: Wed, 29 Apr 2020 18:21:20 +0200	[thread overview]
Message-ID: <20200429162120.GB12716@quack2.suse.cz> (raw)
In-Reply-To: <20200429142230.GE5462@mtj.thefacebook.com>

On Wed 29-04-20 10:22:30, Tejun Heo wrote:
> Hello,
> 
> On Wed, Apr 29, 2020 at 12:25:40PM +0200, Jan Kara wrote:
> > Yeah, I was thinking about the same when reading the patch series
> > description. We already have some cgroup workarounds for btrfs kthreads if
> > I remember correctly, we have cgroup handling for flush workers, now we are
> > adding cgroup handling for loopback device workers, and soon I'd expect
> > someone comes with a need for DM/MD worker processes and IMHO it's getting
> > out of hands because the complexity spreads through the kernel with every
> > subsystem comming with slightly different solution to the problem and also
> > the number of kthreads gets multiplied by the number of cgroups. So I
> > agree some generic solution how to approach IO throttling of kthreads /
> > workers would be desirable.
> > 
> > OTOH I don't have a great idea how the generic infrastructure should look
> > like...
> 
> I don't really see a way around that. The only generic solution would be
> letting all IOs through as root and handle everything through backcharging,
> which we already can do as backcharging is already in use to handle metadata
> updates which can't be controlled directly. However, doing that for all IOs
> would make the control quality a lot worse as all control would be based on
> first incurring deficit and then try to punish the issuer after the fact.

Yeah, it will be probably somewhat worse but OTOH given we'd track the IO
balance per cgroup there will deficit only when a cgroup is starting so it
could be bearable. I'm more concerned about issues like that for some IO
controllers (e.g. for blk-iolatency or for the work preserving
controllers), it is not obvious how to sensibly estimate some cost to
charge to a cgroup since these controllers are more about giving priority
to IO of some cgroup in presence of IO from another cgroup rather than some
hard throughput limit or something like that.

> The infrastructure work done to make IO control work for btrfs is generic
> and the changes needed on btrfs side was pretty small. Most of the work was
> identifying non-regular IO pathways (bouncing through different kthreads and
> whatnot) and making sure they're annotating IO ownership and the needed
> mechanism correctly. The biggest challenge probably is ensuring that the
> filesystem doesn't add ordering dependency between separate data IOs, which
> is a nice property to have with or without cgroup support.
> 
> That leaves the nesting drivers, loop and md/dm. Given that they sit in the
> middle of IO stack and proxy a lot of its roles, they'll have to be updated
> to be transparent in terms of cgroup ownership if IO control is gonna work
> through them. Maybe we can have a common infra shared between loop, dm and
> md but they aren't many and may also be sufficiently different. idk

Yeah, as I said, I don't really have a better alternative :-|

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

  reply	other threads:[~2020-04-29 16:21 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-28 16:13 [PATCH v5 0/4] Charge loop device i/o to issuing cgroup Dan Schatzberg
2020-04-28 16:13 ` [PATCH v5 1/4] loop: Use worker per cgroup instead of kworker Dan Schatzberg
2020-04-28 16:13 ` [PATCH v5 2/4] mm: support nesting memalloc_use_memcg() Dan Schatzberg
2020-04-28 16:13 ` [PATCH v5 3/4] mm: Charge active memcg when no mm is set Dan Schatzberg
2020-04-28 16:13 ` [PATCH v5 4/4] loop: Charge i/o to mem and blk cg Dan Schatzberg
2020-04-28 21:47 ` [PATCH v5 0/4] Charge loop device i/o to issuing cgroup Dave Chinner
2020-04-29  2:27   ` Johannes Weiner
2020-05-05  6:29     ` Dave Chinner
2020-05-05 13:55       ` Shakeel Butt
2020-05-05 15:02       ` Johannes Weiner
2020-04-29 10:25   ` Jan Kara
2020-04-29 14:22     ` Tejun Heo
2020-04-29 16:21       ` Jan Kara [this message]
2020-05-05  6:41     ` Dave Chinner
2020-05-05 15:38       ` Tejun Heo
2020-04-29 14:03   ` Dan Schatzberg
2020-05-12 13:25 ` Dan Schatzberg
2020-05-12 13:35   ` Christoph Hellwig
2020-05-26 14:28     ` Dan Schatzberg
2020-05-27  5:09       ` Christoph Hellwig

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=20200429162120.GB12716@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=amir73il@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=cgroups@vger.kernel.org \
    --cc=chris@chrisdown.name \
    --cc=david@fromorbit.com \
    --cc=guro@fb.com \
    --cc=hannes@cmpxchg.org \
    --cc=hughd@google.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lizefan@huawei.com \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhocko@kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=schatzberg.dan@gmail.com \
    --cc=shakeelb@google.com \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    --cc=vdavydov.dev@gmail.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=yang.shi@linux.alibaba.com \
    /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).