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()
65 ksft_print_msg("Failed to open /proc/sys/vm/compact_unevictable_allowed: %s\n", in prereq()
67 return -1; in prereq()
71 ksft_print_msg("Failed to read from /proc/sys/vm/compact_unevictable_allowed: %s\n", in prereq()
74 return -1; in prereq()
82 return -1; in prereq()
88 int fd, ret = -1; in check_compaction()
97 fd = open("/proc/sys/vm/nr_hugepages", O_RDWR | O_NONBLOCK); in check_compaction()
99 ksft_print_msg("Failed to open /proc/sys/vm/nr_hugepages: %s\n", in check_compaction()
101 ret = -1; in check_compaction()
106 ksft_print_msg("Failed to read from /proc/sys/vm/nr_hugepages: %s\n", in check_compaction()
115 ksft_print_msg("Failed to write 0 to /proc/sys/vm/nr_hugepages: %s\n", in check_compaction()
125 ksft_print_msg("Failed to write 100000 to /proc/sys/vm/nr_hugepages: %s\n", in check_compaction()
133 ksft_print_msg("Failed to re-read from /proc/sys/vm/nr_hugepages: %s\n", in check_compaction()
151 ksft_print_msg("Failed to write value to /proc/sys/vm/nr_hugepages: %s\n", in check_compaction()
180 void *map = NULL; in main() local
205 map = mmap(NULL, MAP_SIZE, PROT_READ | PROT_WRITE, in main()
206 MAP_ANONYMOUS | MAP_PRIVATE | MAP_LOCKED, -1, 0); in main()
207 if (map == MAP_FAILED) in main()
212 munmap(map, MAP_SIZE); in main()
215 entry->map = map; in main()
216 entry->next = list; in main()
219 /* Write something (in this case the address of the map) to in main()
223 *(unsigned long *)(map + i) = (unsigned long)map + i; in main()
225 mem_fragmentable_MB -= MAP_SIZE_MB; in main()
228 for (entry = list; entry != NULL; entry = entry->next) { in main()
229 munmap(entry->map, MAP_SIZE); in main()
230 if (!entry->next) in main()
232 entry = entry->next; in main()