Re: [PATCH 1/3] cgroup: Allocate cgroup_file_ctx for kernfs_open_file->priv

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 23, 2022 at 05:01:00PM +0100, Michal Koutný wrote:
> From: Tejun Heo <tj@xxxxxxxxxx>
> 
> commit 0d2b5955b36250a9428c832664f2079cbf723bec upstream.
> 
> of->priv is currently used by each interface file implementation to store
> private information. This patch collects the current two private data usages
> into struct cgroup_file_ctx which is allocated and freed by the common path.
> This allows generic private data which applies to multiple files, which will
> be used to in the following patch.
> 
> Note that cgroup_procs iterator is now embedded as procs.iter in the new
> cgroup_file_ctx so that it doesn't need to be allocated and freed
> separately.
> 
> v2: union dropped from cgroup_file_ctx and the procs iterator is embedded in
>     cgroup_file_ctx as suggested by Linus.
> 
> v3: Michal pointed out that cgroup1's procs pidlist uses of->priv too.
>     Converted. Didn't change to embedded allocation as cgroup1 pidlists get
>     stored for caching.
> 
> Signed-off-by: Tejun Heo <tj@xxxxxxxxxx>
> Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
> Reviewed-by: Michal Koutný <mkoutny@xxxxxxxx>
> [mkoutny: v5.10: modify cgroup.pressure handlers, adjust context]
> Signed-off-by: Michal Koutný <mkoutny@xxxxxxxx>
> ---

All now queued up, thanks.

greg k-h



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux