thuge-gen.c (8192bc03d908c60c95b72dd0acfc8e37a33ab2f7) thuge-gen.c (cc937dad85aea4ab9e4f9827d7ea55932c86906b)
1// SPDX-License-Identifier: GPL-2.0
2/* Test selecting other page sizes for mmap/shmget.
3
4 Before running this huge pages for each huge page size must have been
5 reserved.
6 For large pages beyond MAX_PAGE_ORDER (like 1GB on x86) boot options must
7 be used. 1GB wouldn't be tested if it isn't available.
8 Also shmmax must be increased.
9 And you need to run as root to work around some weird permissions in shm.
10 And nothing using huge pages should run in parallel.
11 When the program aborts you may need to clean up the shm segments with
12 ipcrm -m by hand, like this
13 sudo ipcs | awk '$1 == "0x00000000" {print $2}' | xargs -n1 sudo ipcrm -m
14 (warning this will remove all if someone else uses them) */
15
1// SPDX-License-Identifier: GPL-2.0
2/* Test selecting other page sizes for mmap/shmget.
3
4 Before running this huge pages for each huge page size must have been
5 reserved.
6 For large pages beyond MAX_PAGE_ORDER (like 1GB on x86) boot options must
7 be used. 1GB wouldn't be tested if it isn't available.
8 Also shmmax must be increased.
9 And you need to run as root to work around some weird permissions in shm.
10 And nothing using huge pages should run in parallel.
11 When the program aborts you may need to clean up the shm segments with
12 ipcrm -m by hand, like this
13 sudo ipcs | awk '$1 == "0x00000000" {print $2}' | xargs -n1 sudo ipcrm -m
14 (warning this will remove all if someone else uses them) */
15
16#define _GNU_SOURCE 1
16#define _GNU_SOURCE
17#include <sys/mman.h>
18#include <linux/mman.h>
19#include <stdlib.h>
20#include <stdio.h>
21#include <sys/ipc.h>
22#include <sys/shm.h>
23#include <sys/stat.h>
24#include <glob.h>

--- 225 unchanged lines hidden ---
17#include <sys/mman.h>
18#include <linux/mman.h>
19#include <stdlib.h>
20#include <stdio.h>
21#include <sys/ipc.h>
22#include <sys/shm.h>
23#include <sys/stat.h>
24#include <glob.h>

--- 225 unchanged lines hidden ---