[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220504122558.GB24172@blackbody.suse.cz>
Date: Wed, 4 May 2022 14:25:58 +0200
From: Michal Koutný <mkoutny@...e.com>
To: "T.J. Mercier" <tjmercier@...gle.com>
Cc: Tejun Heo <tj@...nel.org>, Zefan Li <lizefan.x@...edance.com>,
Johannes Weiner <hannes@...xchg.org>, daniel@...ll.ch,
hridya@...gle.com, christian.koenig@....com, jstultz@...gle.com,
tkjos@...roid.com, cmllamas@...gle.com, surenb@...gle.com,
kaleshsingh@...gle.com, Kenny.Ho@....com,
skhan@...uxfoundation.org, kernel-team@...roid.com,
linux-kernel@...r.kernel.org, cgroups@...r.kernel.org
Subject: Re: [PATCH v6 2/6] cgroup: gpu: Add a cgroup controller for
allocator attribution of GPU memory
Hello.
On Mon, May 02, 2022 at 11:19:36PM +0000, "T.J. Mercier" <tjmercier@...gle.com> wrote:
> This patch adds APIs to:
> -allow a device to register for memory accounting using the GPU cgroup
> controller.
> -charge and uncharge allocated memory to a cgroup.
Is this API for separately built consumers?
The respective functions should be exported (EXPORT_SYMBOL_GPL) if I
haven't missed anything.
> +#ifdef CONFIG_CGROUP_GPU
> + /* The GPU cgroup controller data structure */
> +struct gpucg {
> + struct cgroup_subsys_state css;
> +
> + /* list of all resource pools that belong to this cgroup */
> + struct list_head rpools;
> +};
> +
> +/* A named entity representing bucket of tracked memory. */
> +struct gpucg_bucket {
> + /* list of various resource pools in various cgroups that the bucket is part of */
> + struct list_head rpools;
> +
> + /* list of all buckets registered for GPU cgroup accounting */
> + struct list_head bucket_node;
> +
> + /* string to be used as identifier for accounting and limit setting */
> + const char *name;
> +};
Do these struct have to be defined "publicly"?
I.e. the driver code could just work with gpucg and gpucg_bucket
pointers.
> +int gpucg_register_bucket(struct gpucg_bucket *bucket, const char *name)
...and the registration function would return a pointer to newly
(internally) allocated gpucg_bucket.
Regards,
Michal
Powered by blists - more mailing lists