Lines Matching +full:vm +full:- +full:map
1 // SPDX-License-Identifier: GPL-2.0
25 void *map; member
32 char *cmd = "cat /proc/meminfo | grep -i memfree | grep -o '[0-9]*'"; in read_memory_info()
37 return -1; in read_memory_info()
43 cmd = "cat /proc/meminfo | grep -i hugepagesize | grep -o '[0-9]*'"; in read_memory_info()
48 return -1; in read_memory_info()
62 fd = open("/proc/sys/vm/compact_unevictable_allowed", in prereq()
66 "/proc/sys/vm/compact_unevictable_allowed\n"); in prereq()
67 return -1; in prereq()
72 "/proc/sys/vm/compact_unevictable_allowed\n"); in prereq()
74 return -1; in prereq()
81 return -1; in prereq()
95 fd = open("/proc/sys/vm/nr_hugepages", O_RDWR | O_NONBLOCK); in check_compaction()
97 perror("Failed to open /proc/sys/vm/nr_hugepages"); in check_compaction()
98 return -1; in check_compaction()
102 perror("Failed to read from /proc/sys/vm/nr_hugepages"); in check_compaction()
108 perror("Failed to write 0 to /proc/sys/vm/nr_hugepages\n"); in check_compaction()
117 perror("Failed to write 100000 to /proc/sys/vm/nr_hugepages\n"); in check_compaction()
124 perror("Failed to re-read from /proc/sys/vm/nr_hugepages\n"); in check_compaction()
147 perror("Failed to write value to /proc/sys/vm/nr_hugepages\n"); in check_compaction()
157 return -1; in check_compaction()
166 void *map = NULL; in main() local
182 return -1; in main()
191 return -1; in main()
197 map = mmap(NULL, MAP_SIZE, PROT_READ | PROT_WRITE, in main()
198 MAP_ANONYMOUS | MAP_PRIVATE | MAP_LOCKED, -1, 0); in main()
199 if (map == MAP_FAILED) in main()
204 munmap(map, MAP_SIZE); in main()
207 entry->map = map; in main()
208 entry->next = list; in main()
211 /* Write something (in this case the address of the map) to in main()
215 *(unsigned long *)(map + i) = (unsigned long)map + i; in main()
217 mem_fragmentable_MB -= MAP_SIZE_MB; in main()
220 for (entry = list; entry != NULL; entry = entry->next) { in main()
221 munmap(entry->map, MAP_SIZE); in main()
222 if (!entry->next) in main()
224 entry = entry->next; in main()
230 return -1; in main()