Re: [PATCH] fs: Add FOP_HUGE_PAGES

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

 



On Mon, Apr 08, 2024 at 04:02:17PM +0100, Al Viro wrote:
> On Sun, Apr 07, 2024 at 09:11:20PM +0100, Matthew Wilcox (Oracle) wrote:
> > -static inline bool is_file_hugepages(struct file *file)
> > +static inline bool is_file_hugepages(const struct file *file)
> >  {
> > -	if (file->f_op == &hugetlbfs_file_operations)
> > -		return true;
> > -
> > -	return is_file_shm_hugepages(file);
> > +	return file->f_op->fop_flags & FOP_HUGE_PAGES;
> >  }
> 
> Extra cacheline to pull can be costly on a sufficiently hot path...

Sure, but so can a function call, particularly with the $%^&@#
CPU mitigations.  Yes, is_file_hugepages() is inline, but
is_file_shm_hugepages() is not.  The cacheline in question should be
shared since it's part of fops, which is const.

I'm not seeing is_file_hugepages() called on any partcularly hot paths.
Most of the callers are in mmap() equivalent paths.




[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