Commit c4a0f7a
committed
selftests/mm: virtual_address_range: unmap chunks after validation
JIRA: https://issues.redhat.com/browse/RHEL-88165
commit b2a79f6
Author: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Date: Tue Jan 14 17:06:46 2025 +0100
selftests/mm: virtual_address_range: unmap chunks after validation
For each accessed chunk a PTE is created. More than 1GiB of PTEs is used
in this way. Remove each PTE after validating a chunk to reduce peak
memory usage.
It is important to only unmap memory that previously mmap()ed, as
unmapping other mappings like the stack, heap or executable mappings will
crash the process.
The mappings read from /proc/self/maps and the return values from mmap()
don't allow a simple correlation due to merging and no guaranteed order.
To correlate the pointers and mappings use prctl(PR_SET_VMA_ANON_NAME).
While it introduces a test dependency, other alternatives would introduce
runtime or development overhead.
Link: https://lkml.kernel.org/r/20250114-virtual_address_range-tests-v4-2-6fd7269934a5@linutronix.de
Fixes: 0104096 ("selftests/mm: confirm VA exhaustion without reliance on correctness of mmap()")
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: Anshuman Khandual <khandual@linux.vnet.ibm.com>
Cc: Dev Jain <dev.jain@arm.com>
Cc: kernel test robot <oliver.sang@intel.com>
Cc: Shuah Khan (Samsung OSG) <shuah@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Li Wang <liwang@redhat.com>1 parent 4557047 commit c4a0f7a
2 files changed
+32
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
85 | 104 | | |
86 | 105 | | |
87 | 106 | | |
| |||
116 | 135 | | |
117 | 136 | | |
118 | 137 | | |
| 138 | + | |
| 139 | + | |
119 | 140 | | |
120 | 141 | | |
121 | | - | |
122 | | - | |
| 142 | + | |
| 143 | + | |
123 | 144 | | |
124 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
125 | 149 | | |
126 | 150 | | |
127 | 151 | | |
| |||
149 | 173 | | |
150 | 174 | | |
151 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
152 | 179 | | |
153 | 180 | | |
154 | 181 | | |
| |||
175 | 202 | | |
176 | 203 | | |
177 | 204 | | |
| 205 | + | |
178 | 206 | | |
179 | 207 | | |
180 | 208 | | |
| |||
192 | 220 | | |
193 | 221 | | |
194 | 222 | | |
| 223 | + | |
195 | 224 | | |
196 | 225 | | |
197 | 226 | | |
| |||
0 commit comments