[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZJn1tQDgfmcE7mNG@slm.duckdns.org>
Date: Mon, 26 Jun 2023 10:31:49 -1000
From: Tejun Heo <tj@...nel.org>
To: Suren Baghdasaryan <surenb@...gle.com>
Cc: gregkh@...uxfoundation.org, peterz@...radead.org,
lujialin4@...wei.com, lizefan.x@...edance.com, hannes@...xchg.org,
mingo@...hat.com, ebiggers@...nel.org, oleg@...hat.com,
akpm@...ux-foundation.org, viro@...iv.linux.org.uk,
brauner@...nel.org, juri.lelli@...hat.com,
vincent.guittot@...aro.org, dietmar.eggemann@....com,
rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
bristot@...hat.com, vschneid@...hat.com,
linux-kernel@...r.kernel.org, cgroups@...r.kernel.org,
linux-fsdevel@...r.kernel.org, kernel-team@...roid.com
Subject: Re: [PATCH 1/2] kernfs: add kernfs_ops.free operation to free
resources tied to the file
On Mon, Jun 26, 2023 at 01:17:12PM -0700, Suren Baghdasaryan wrote:
> diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h
> index 73f5c120def8..a7e404ff31bb 100644
> --- a/include/linux/kernfs.h
> +++ b/include/linux/kernfs.h
> @@ -273,6 +273,11 @@ struct kernfs_ops {
> */
> int (*open)(struct kernfs_open_file *of);
> void (*release)(struct kernfs_open_file *of);
> + /*
> + * Free resources tied to the lifecycle of the file, like a
> + * waitqueue used for polling.
> + */
> + void (*free)(struct kernfs_open_file *of);
I think this can use a bit more commenting - ie. explain that release may be
called earlier than the actual freeing of the file and how that can lead to
problems. Othre than that, looks fine to me.
Greg, as Suren suggested, I can route both patches through the cgroup tree
if you're okay with it.
Thanks.
--
tejun
Powered by blists - more mailing lists