1
2 #ifndef _LINUX_MM_TYPES_TASK_H
3 #define _LINUX_MM_TYPES_TASK_H
4
5
6
7
8
9
10
11 #include <linux/types.h>
12 #include <linux/threads.h>
13 #include <linux/atomic.h>
14 #include <linux/cpumask.h>
15
16 #include <asm/page.h>
17
18 #ifdef CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH
19 #include <asm/tlbbatch.h>
20 #endif
21
22 #define USE_SPLIT_PTE_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS)
23 #define USE_SPLIT_PMD_PTLOCKS (USE_SPLIT_PTE_PTLOCKS && \
24 IS_ENABLED(CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK))
25 #define ALLOC_SPLIT_PTLOCKS (SPINLOCK_SIZE > BITS_PER_LONG/8)
26
27
28
29
30 #define VMACACHE_BITS 2
31 #define VMACACHE_SIZE (1U << VMACACHE_BITS)
32 #define VMACACHE_MASK (VMACACHE_SIZE - 1)
33
34 struct vmacache {
35 u64 seqnum;
36 struct vm_area_struct *vmas[VMACACHE_SIZE];
37 };
38
39
40
41
42
43 enum {
44 MM_FILEPAGES,
45 MM_ANONPAGES,
46 MM_SWAPENTS,
47 MM_SHMEMPAGES,
48 NR_MM_COUNTERS
49 };
50
51 #if USE_SPLIT_PTE_PTLOCKS && defined(CONFIG_MMU)
52 #define SPLIT_RSS_COUNTING
53
54 struct task_rss_stat {
55 int events;
56 int count[NR_MM_COUNTERS];
57 };
58 #endif
59
60 struct mm_rss_stat {
61 atomic_long_t count[NR_MM_COUNTERS];
62 };
63
64 struct page_frag {
65 struct page *page;
66 #if (BITS_PER_LONG > 32) || (PAGE_SIZE >= 65536)
67 __u32 offset;
68 __u32 size;
69 #else
70 __u16 offset;
71 __u16 size;
72 #endif
73 };
74
75
76 struct tlbflush_unmap_batch {
77 #ifdef CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH
78
79
80
81
82
83
84
85 struct arch_tlbflush_unmap_batch arch;
86
87
88 bool flush_required;
89
90
91
92
93
94
95 bool writable;
96 #endif
97 };
98
99 #endif