Re: [PATCH 5/5] mm: simplify bdi refcounting

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

 



On Wed 27-10-21 09:42:07, Christoph Hellwig wrote:
> On Fri, Oct 22, 2021 at 11:02:03AM +0200, Jan Kara wrote:
> > On Thu 21-10-21 14:44:41, Christoph Hellwig wrote:
> > > Move grabbing and releasing the bdi refcount out of the common
> > > wb_init/wb_exit helpers into code that is only used for the non-default
> > > memcg driven bdi_writeback structures.
> > > 
> > > Signed-off-by: Christoph Hellwig <hch@xxxxxx>
> > 
> > Can we perhaps add a comment to struct bdi_writeback definition (or maybe
> > wb_init()?) mentioning that it holds a reference to 'bdi' if it is
> > bdi_writeback struct for a cgroup? I don't see it mentioned anywhere and
> > now that you've changed the code, it isn't that obvious from the code
> > either... Otherwise the patch looks good so feel free to add:
> 
> Like this?
> 
> diff --git a/include/linux/backing-dev-defs.h b/include/linux/backing-dev-defs.h
> index 33207004cfded..a3d7dd1cc30a1 100644
> --- a/include/linux/backing-dev-defs.h
> +++ b/include/linux/backing-dev-defs.h
> @@ -103,6 +103,9 @@ struct wb_completion {
>   * change as blkcg is disabled and enabled higher up in the hierarchy, a wb
>   * is tested for blkcg after lookup and removed from index on mismatch so
>   * that a new wb for the combination can be created.
> + *
> + * Each bdi_writeback that is no embedded into the backing_dev_info must hold
				 ^^^ not

> + * a reference to the parent backing_dev_info.  See cgwb_create() for details.
>   */

Otherwise looks nice. Thanks!

								Honza

-- 
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux