[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7oxj33pfscydm6vgdpl5vppxbx5htqg6rjfyd7qyg27p3bu2gk@wzl3x3dgurom>
Date: Wed, 7 Feb 2024 16:28:24 +0100
From: Michal Koutný <mkoutny@...e.com>
To: Tvrtko Ursulin <tvrtko.ursulin@...ux.intel.com>
Cc: Intel-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
cgroups@...r.kernel.org, linux-kernel@...r.kernel.org, Tejun Heo <tj@...nel.org>,
Johannes Weiner <hannes@...xchg.org>, Zefan Li <lizefan.x@...edance.com>,
Dave Airlie <airlied@...hat.com>, Daniel Vetter <daniel.vetter@...ll.ch>,
Rob Clark <robdclark@...omium.org>, Stéphane Marchesin <marcheu@...omium.org>,
"T . J . Mercier" <tjmercier@...gle.com>, Kenny.Ho@....com,
Christian König <christian.koenig@....com>, Brian Welty <brian.welty@...el.com>,
Tvrtko Ursulin <tvrtko.ursulin@...el.com>
Subject: Re: [RFC 1/8] cgroup: Add the DRM cgroup controller
Hello.
On Tue, Oct 24, 2023 at 05:07:20PM +0100, Tvrtko Ursulin <tvrtko.ursulin@...ux.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
Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)
Powered by blists - more mailing lists