1 #ifndef __LINUX_VMACACHE_H
2 #define __LINUX_VMACACHE_H
4 #include <linux/sched.h>
8 * Hash based on the page number. Provides a good hit rate for
9 * workloads with good locality and those with random accesses as well.
11 #define VMACACHE_HASH(addr) ((addr >> PAGE_SHIFT) & VMACACHE_MASK)
13 static inline void vmacache_flush(struct task_struct *tsk)
15 memset(tsk->vmacache.vmas, 0, sizeof(tsk->vmacache.vmas));
18 extern void vmacache_flush_all(struct mm_struct *mm);
19 extern void vmacache_update(unsigned long addr, struct vm_area_struct *newvma);
20 extern struct vm_area_struct *vmacache_find(struct mm_struct *mm,
24 extern struct vm_area_struct *vmacache_find_exact(struct mm_struct *mm,
29 static inline void vmacache_invalidate(struct mm_struct *mm)
31 mm->vmacache_seqnum++;
33 /* deal with overflows */
34 if (unlikely(mm->vmacache_seqnum == 0))
35 vmacache_flush_all(mm);
38 #endif /* __LINUX_VMACACHE_H */