Re: [PATCH v4 07/36] fs: Add a filesystem flag for large pages

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

 



On Fri, May 22, 2020 at 07:55:23AM +1000, Dave Chinner wrote:
> If you've got to dereference 4 layers deep to check a behaviour
> flag, the object needs it's own flag.  Can you just propagate this
> to the address space when the inode is instantiated and the address
> space initialised?

Sure.  I'll fold in something like this:

+++ b/fs/inode.c
@@ -181,6 +181,8 @@ int inode_init_always(struct super_block *sb, struct inode *inode)
        mapping->a_ops = &empty_aops;
        mapping->host = inode;
        mapping->flags = 0;
+       if (sb->s_type->fs_flags & FS_LARGE_PAGES)
+               __set_bit(AS_LARGE_PAGES, &mapping->flags);
        mapping->wb_err = 0;
        atomic_set(&mapping->i_mmap_writable, 0);
 #ifdef CONFIG_READ_ONLY_THP_FOR_FS
+++ b/include/linux/pagemap.h
@@ -29,6 +29,7 @@ enum mapping_flags {
        AS_EXITING      = 4,    /* final truncate in progress */
        /* writeback related tags are not used */
        AS_NO_WRITEBACK_TAGS = 5,
+       AS_LARGE_PAGES = 6,     /* large pages supported */
 };
 
 /**
@@ -118,7 +119,7 @@ static inline void mapping_set_gfp_mask(struct address_space *m, gfp_t mask)
 
 static inline bool mapping_large_pages(struct address_space *mapping)
 {
-       return mapping->host->i_sb->s_type->fs_flags & FS_LARGE_PAGES;
+       return test_bit(AS_LARGE_PAGES, &mapping->flags);
 }
 
 static inline int filemap_nr_thps(struct address_space *mapping)






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

  Powered by Linux