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()
103 fd = open("/proc/sys/vm/nr_hugepages", O_RDWR | O_NONBLOCK); in check_compaction()
105 ksft_print_msg("Failed to open /proc/sys/vm/nr_hugepages: %s\n", in check_compaction()
107 ret = -1; in check_compaction()
121 ksft_print_msg("Failed to write %lu to /proc/sys/vm/nr_hugepages: %s\n", in check_compaction()
129 ksft_print_msg("Failed to re-read from /proc/sys/vm/nr_hugepages: %s\n", in check_compaction()
147 ksft_print_msg("Failed to write value to /proc/sys/vm/nr_hugepages: %s\n", in check_compaction()
172 int fd, ret = -1; in set_zero_hugepages()
175 fd = open("/proc/sys/vm/nr_hugepages", O_RDWR | O_NONBLOCK); in set_zero_hugepages()
177 ksft_print_msg("Failed to open /proc/sys/vm/nr_hugepages: %s\n", in set_zero_hugepages()
182 ksft_print_msg("Failed to read from /proc/sys/vm/nr_hugepages: %s\n", in set_zero_hugepages()
191 ksft_print_msg("Failed to write 0 to /proc/sys/vm/nr_hugepages: %s\n", in set_zero_hugepages()
211 void *map = NULL; in main() local
241 map = mmap(NULL, MAP_SIZE, PROT_READ | PROT_WRITE, in main()
242 MAP_ANONYMOUS | MAP_PRIVATE | MAP_LOCKED, -1, 0); in main()
243 if (map == MAP_FAILED) in main()
248 munmap(map, MAP_SIZE); in main()
251 entry->map = map; in main()
252 entry->next = list; in main()
255 /* Write something (in this case the address of the map) to in main()
259 *(unsigned long *)(map + i) = (unsigned long)map + i; in main()
261 mem_fragmentable_MB -= MAP_SIZE_MB; in main()
264 for (entry = list; entry != NULL; entry = entry->next) { in main()
265 munmap(entry->map, MAP_SIZE); in main()
266 if (!entry->next) in main()
268 entry = entry->next; in main()