Blame view

include/linux/vmacache.h 932 Bytes
b24413180   Greg Kroah-Hartman   License cleanup: ...
1
  /* SPDX-License-Identifier: GPL-2.0 */
615d6e875   Davidlohr Bueso   mm: per-thread vm...
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  #ifndef __LINUX_VMACACHE_H
  #define __LINUX_VMACACHE_H
  
  #include <linux/sched.h>
  #include <linux/mm.h>
  
  /*
   * Hash based on the page number. Provides a good hit rate for
   * workloads with good locality and those with random accesses as well.
   */
  #define VMACACHE_HASH(addr) ((addr >> PAGE_SHIFT) & VMACACHE_MASK)
  
  static inline void vmacache_flush(struct task_struct *tsk)
  {
314ff7851   Ingo Molnar   mm/vmacache, sche...
16
  	memset(tsk->vmacache.vmas, 0, sizeof(tsk->vmacache.vmas));
615d6e875   Davidlohr Bueso   mm: per-thread vm...
17
  }
615d6e875   Davidlohr Bueso   mm: per-thread vm...
18
19
20
21
22
23
24
25
26
27
28
29
30
  extern void vmacache_update(unsigned long addr, struct vm_area_struct *newvma);
  extern struct vm_area_struct *vmacache_find(struct mm_struct *mm,
  						    unsigned long addr);
  
  #ifndef CONFIG_MMU
  extern struct vm_area_struct *vmacache_find_exact(struct mm_struct *mm,
  						  unsigned long start,
  						  unsigned long end);
  #endif
  
  static inline void vmacache_invalidate(struct mm_struct *mm)
  {
  	mm->vmacache_seqnum++;
615d6e875   Davidlohr Bueso   mm: per-thread vm...
31
32
33
  }
  
  #endif /* __LINUX_VMACACHE_H */