lkml.org 
[lkml]   [2024]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC 1/8] cgroup: Add the DRM cgroup controller
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
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2024-05-27 14:53    [W:0.122 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site