cgroups.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michal Koutný" <mkoutny@suse.com>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: Intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Tejun Heo" <tj@kernel.org>,
	"Johannes Weiner" <hannes@cmpxchg.org>,
	"Zefan Li" <lizefan.x@bytedance.com>,
	"Dave Airlie" <airlied@redhat.com>,
	"Daniel Vetter" <daniel.vetter@ffwll.ch>,
	"Rob Clark" <robdclark@chromium.org>,
	"Stéphane Marchesin" <marcheu@chromium.org>,
	"T . J . Mercier" <tjmercier@google.com>,
	Kenny.Ho@amd.com, "Christian König" <christian.koenig@amd.com>,
	"Brian Welty" <brian.welty@intel.com>,
	"Tvrtko Ursulin" <tvrtko.ursulin@intel.com>
Subject: Re: [RFC 1/8] cgroup: Add the DRM cgroup controller
Date: Wed, 7 Feb 2024 16:28:24 +0100	[thread overview]
Message-ID: <7oxj33pfscydm6vgdpl5vppxbx5htqg6rjfyd7qyg27p3bu2gk@wzl3x3dgurom> (raw)
In-Reply-To: <20231024160727.282960-2-tvrtko.ursulin@linux.intel.com>

[-- Attachment #1: Type: text/plain, Size: 764 bytes --]

Hello.

On Tue, Oct 24, 2023 at 05:07:20PM +0100, Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> wrote:
> +struct drm_cgroup_state {
> +	struct cgroup_subsys_state css;
> +};
> +
> +struct drm_root_cgroup_state {
> +	struct drm_cgroup_state drmcs;
> +};
> +
> +static struct drm_root_cgroup_state root_drmcs;

Special struct type for root state is uncommon.
Have 
struct drm_cgroup_state root_drmcs;
and possible future members can be global state variables.


> +static void drmcs_free(struct cgroup_subsys_state *css)
> +{
> +	struct drm_cgroup_state *drmcs = css_to_drmcs(css);
> +
> +	if (drmcs != &root_drmcs.drmcs)
> +		kfree(drmcs);
> +}

I think it can be relied on root cgroup not being ever free'd by cgroup
core.

Michal

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2024-02-07 15:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-24 16:07 [RFC v6 0/8] DRM scheduling cgroup controller Tvrtko Ursulin
2023-10-24 16:07 ` [RFC 1/8] cgroup: Add the DRM " Tvrtko Ursulin
2024-02-07 15:28   ` Michal Koutný [this message]
2023-10-24 16:07 ` [RFC 2/8] drm/cgroup: Track DRM clients per cgroup Tvrtko Ursulin
2023-10-24 16:07 ` [RFC 3/8] drm/cgroup: Add ability to query drm cgroup GPU time Tvrtko Ursulin
2023-10-24 16:07 ` [RFC 4/8] drm/cgroup: Add over budget signalling callback Tvrtko Ursulin
2023-10-24 16:07 ` [RFC 5/8] drm/cgroup: Only track clients which are providing drm_cgroup_ops Tvrtko Ursulin
2023-10-24 16:07 ` [RFC 6/8] cgroup/drm: Introduce weight based drm cgroup control Tvrtko Ursulin
2024-02-07 15:28   ` Michal Koutný
2023-10-24 16:07 ` [RFC 7/8] drm/i915: Implement cgroup controller over budget throttling Tvrtko Ursulin
2023-10-24 16:07 ` [RFC 8/8] cgroup/drm: Expose GPU utilisation Tvrtko Ursulin
2023-11-12 20:38 ` [RFC v6 0/8] DRM scheduling cgroup controller Tejun Heo

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=7oxj33pfscydm6vgdpl5vppxbx5htqg6rjfyd7qyg27p3bu2gk@wzl3x3dgurom \
    --to=mkoutny@suse.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=Kenny.Ho@amd.com \
    --cc=airlied@redhat.com \
    --cc=brian.welty@intel.com \
    --cc=cgroups@vger.kernel.org \
    --cc=christian.koenig@amd.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan.x@bytedance.com \
    --cc=marcheu@chromium.org \
    --cc=robdclark@chromium.org \
    --cc=tj@kernel.org \
    --cc=tjmercier@google.com \
    --cc=tvrtko.ursulin@intel.com \
    --cc=tvrtko.ursulin@linux.intel.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 read-only IMAP folder(s) and NNTP newsgroup(s).