public inbox for cgroups@vger.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Sagi Grimberg <sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
Cc: Ofir Gal <ofir.gal-83CFe9096HFBDgjK7y7TUQ@public.gmane.org>,
	Chaitanya Kulkarni
	<chaitanyak-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
	"hch-jcswGhMUV9g@public.gmane.org"
	<hch-jcswGhMUV9g@public.gmane.org>,
	"linux-nvme-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-nvme-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] nvmet: allow associating port to a cgroup via configfs
Date: Mon, 3 Jul 2023 09:16:21 -1000	[thread overview]
Message-ID: <ZKMehaAF0v-nV1qt@slm.duckdns.org> (raw)
In-Reply-To: <ab204a2d-9a30-7c90-8afa-fc84c935730f-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>

Hello,

On Mon, Jul 03, 2023 at 04:21:40PM +0300, Sagi Grimberg wrote:
> > Thorttiling files and passthru isn't possible with cgroup v1 as well,
> > cgroup v2 broke the abillity to throttle bdevs. The purpose of the patch
> > is to re-enable the broken functionality.
> 
> cgroupv2 didn't break anything, this was never an intended feature of
> the linux nvme target, so it couldn't have been broken. Did anyone
> know that people are doing this with nvmet?

Maybe he's referring to the fact that cgroup1 allowed throttling root
cgroups? Maybe they were throttling from the root cgroup on the client side?

> I'm pretty sure others on the list are treating this as a suggested
> new feature for nvmet. and designing this feature as something that
> is only supported for blkdevs is undersirable.
> 
> > There was an attempt to re-enable the functionality by allowing io
> > throttle on the root cgroup but it's against the cgroup v2 design.
> > Reference:
> > https://lore.kernel.org/r/20220114093000.3323470-1-yukuai3-hv44wF8Li93QT0dZR+AlfA@public.gmane.org/
> > 
> > A full blown nvmet cgroup controller may be a complete solution, but it
> > may take some time to achieve,
> 
> I don't see any other sane solution here.
> 
> Maybe Tejun/others think differently here?

I'm not necessarily against the idea of enabling subsystems to assign cgroup
membership to entities which aren't processes or threads. It does make sense
for cases where a kernel subsystem is serving multiple classes of users
which aren't processes as here and it's likely that we'd need something
similar for certain memory regions in a limited way (e.g. tmpfs chunk shared
across multiple cgroups).

That said, because we haven't done this before, we haven't figured out how
the API should be like and we definitely want something which can be used in
a similar fashion across the board. Also, cgroup does assume that resources
are always associated with processes or threads, and making this work with
non-task entity would require some generalization there. Maybe the solution
is to always have a tying kthread which serves as a proxy for the resource
but that seems a bit nasty at least on the first thought.

In principle, at least from cgroup POV, I think the idea of being able to
assign cgroup membership to subsystem-specific entities is okay. In
practice, there are quite a few challenges to address.

Thanks.

-- 
tejun

  parent reply	other threads:[~2023-07-03 19:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230627100215.1206008-1-ofir.gal@volumez.com>
     [not found] ` <30d03bba-c2e1-7847-f17e-403d4e648228@grimberg.me>
     [not found]   ` <90150ffd-ba2d-6528-21b7-7ea493cd2b9a@nvidia.com>
     [not found]     ` <90150ffd-ba2d-6528-21b7-7ea493cd2b9a-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2023-06-29 15:21       ` [PATCH] nvmet: allow associating port to a cgroup via configfs Ofir Gal
     [not found]         ` <79894bd9-03c7-8d27-eb6a-5e1336550449-83CFe9096HFBDgjK7y7TUQ@public.gmane.org>
2023-06-30 18:26           ` Michal Koutný
2023-07-03 13:21           ` Sagi Grimberg
     [not found]             ` <ab204a2d-9a30-7c90-8afa-fc84c935730f-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
2023-07-03 19:16               ` Tejun Heo [this message]
     [not found]                 ` <ZKMehaAF0v-nV1qt-NiLfg/pYEd1N0TnZuCh8vA@public.gmane.org>
2023-07-04  7:54                   ` Sagi Grimberg
     [not found]                     ` <b181b848-b2c7-4a7e-7173-ff6c771d6731-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
2023-07-06 13:28                       ` Ofir Gal

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=ZKMehaAF0v-nV1qt@slm.duckdns.org \
    --to=tj-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=chaitanyak-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=hch-jcswGhMUV9g@public.gmane.org \
    --cc=linux-nvme-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=ofir.gal-83CFe9096HFBDgjK7y7TUQ@public.gmane.org \
    --cc=sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.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