1 #ifndef _LINUX_MM_TYPES_TASK_H
2 #define _LINUX_MM_TYPES_TASK_H
5 * Here are the definitions of the MM data types that are embedded in 'struct task_struct'.
7 * (These are defined separately to decouple sched.h from mm_types.h as much as possible.)
10 #include <linux/types.h>
11 #include <linux/threads.h>
12 #include <linux/atomic.h>
16 #define USE_SPLIT_PTE_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS)
17 #define USE_SPLIT_PMD_PTLOCKS (USE_SPLIT_PTE_PTLOCKS && \
18 IS_ENABLED(CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK))
19 #define ALLOC_SPLIT_PTLOCKS (SPINLOCK_SIZE > BITS_PER_LONG/8)
22 * The per task VMA cache array:
24 #define VMACACHE_BITS 2
25 #define VMACACHE_SIZE (1U << VMACACHE_BITS)
26 #define VMACACHE_MASK (VMACACHE_SIZE - 1)
30 struct vm_area_struct *vmas[VMACACHE_SIZE];
34 MM_FILEPAGES, /* Resident file mapping pages */
35 MM_ANONPAGES, /* Resident anonymous pages */
36 MM_SWAPENTS, /* Anonymous swap entries */
37 MM_SHMEMPAGES, /* Resident shared memory pages */
41 #if USE_SPLIT_PTE_PTLOCKS && defined(CONFIG_MMU)
42 #define SPLIT_RSS_COUNTING
43 /* per-thread cached information, */
44 struct task_rss_stat {
45 int events; /* for synchronization threshold */
46 int count[NR_MM_COUNTERS];
48 #endif /* USE_SPLIT_PTE_PTLOCKS */
51 atomic_long_t count[NR_MM_COUNTERS];
56 #if (BITS_PER_LONG > 32) || (PAGE_SIZE >= 65536)
65 #endif /* _LINUX_MM_TYPES_TASK_H */