Messages in this thread | | | Date | Wed, 7 Feb 2024 16:28:24 +0100 | From | Michal Koutný <> | 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@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] | |