Re: [RFC PATCH 02/11] pagemap: add mapping_clear_large_folios() wrapper

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

 



On Tue, Dec 13, 2022 at 06:29:26PM +0100, Andrey Albershteyn wrote:
> Add wrapper to clear mapping's large folio flag. This is handy for
> disabling large folios on already existing inodes (e.g. future XFS
> integration of fs-verity).

I have two problems with this.  One is your use of __clear_bit().
We can use __set_bit() because it's done as part of initialisation.
As far as I can tell from your patches, mapping_clear_large_folios() is
called on a live inode, so you'd have to use clear_bit() to avoid races.

The second is that verity should obviously be enhanced to support
large folios (and for that matter, block sizes smaller than PAGE_SIZE).
Without that, this is just a toy or a prototype.  Disabling large folios
is not an option.

I'm happy to work with you to add support for large folios to verity.
It hasn't been high priority for me, but I'm now working on folio support
for bufferhead filesystems and this would probably fit in.

> Signed-off-by: Andrey Albershteyn <aalbersh@xxxxxxxxxx>
> ---
>  include/linux/pagemap.h | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
> index bbccb40442224..63ca600bdf8f7 100644
> --- a/include/linux/pagemap.h
> +++ b/include/linux/pagemap.h
> @@ -306,6 +306,11 @@ static inline void mapping_set_large_folios(struct address_space *mapping)
>  	__set_bit(AS_LARGE_FOLIO_SUPPORT, &mapping->flags);
>  }
>  
> +static inline void mapping_clear_large_folios(struct address_space *mapping)
> +{
> +	__clear_bit(AS_LARGE_FOLIO_SUPPORT, &mapping->flags);
> +}
> +
>  /*
>   * Large folio support currently depends on THP.  These dependencies are
>   * being worked on but are not yet fixed.
> -- 
> 2.31.1
> 



[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