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.