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()
89 int fd, ret = -1; in check_compaction()
101 fd = open("/proc/sys/vm/nr_hugepages", O_RDWR | O_NONBLOCK); in check_compaction()
103 ksft_print_msg("Failed to open /proc/sys/vm/nr_hugepages: %s\n", in check_compaction()
105 ret = -1; in check_compaction()
112 ksft_print_msg("Failed to write 100000 to /proc/sys/vm/nr_hugepages: %s\n", in check_compaction()
120 ksft_print_msg("Failed to re-read from /proc/sys/vm/nr_hugepages: %s\n", in check_compaction()
138 ksft_print_msg("Failed to write value to /proc/sys/vm/nr_hugepages: %s\n", in check_compaction()
163 int fd, ret = -1; in set_zero_hugepages()
166 fd = open("/proc/sys/vm/nr_hugepages", O_RDWR | O_NONBLOCK); in set_zero_hugepages()
168 ksft_print_msg("Failed to open /proc/sys/vm/nr_hugepages: %s\n", in set_zero_hugepages()
173 ksft_print_msg("Failed to read from /proc/sys/vm/nr_hugepages: %s\n", in set_zero_hugepages()
182 ksft_print_msg("Failed to write 0 to /proc/sys/vm/nr_hugepages: %s\n", in set_zero_hugepages()
202 void *map = NULL; in main() local
232 map = mmap(NULL, MAP_SIZE, PROT_READ | PROT_WRITE, in main()
233 MAP_ANONYMOUS | MAP_PRIVATE | MAP_LOCKED, -1, 0); in main()
234 if (map == MAP_FAILED) in main()
239 munmap(map, MAP_SIZE); in main()
242 entry->map = map; in main()
243 entry->next = list; in main()
246 /* Write something (in this case the address of the map) to in main()
250 *(unsigned long *)(map + i) = (unsigned long)map + i; in main()
252 mem_fragmentable_MB -= MAP_SIZE_MB; in main()
255 for (entry = list; entry != NULL; entry = entry->next) { in main()
256 munmap(entry->map, MAP_SIZE); in main()
257 if (!entry->next) in main()
259 entry = entry->next; in main()