Hugetlbfs file mappings are handled differently than regular files:
- pager_req_create will tell us the file is in a hugetlbfs
- allocate memory upfront, we need to fail if not enough memory
- the memory needs to be given again if another process maps the same
file
This implementation still has some hacks, in particular, the memory
needs to be freed when all mappings are done and the file has been
deleted/closed by all processes.
We cannot know when the file is closed/unlinked easily, so clean up
memory when all processes have exited.
To test, install libhugetlbfs and link a program with the additional
LDFLAGS += -B /usr/share/libhugetlbfs -Wl,--hugetlbfs-align
Then run with HUGETLB_ELFMAP=RW set, you can check this works with
HUGETLB_DEBUG=1 HUGETLB_VERBOSE=2
Change-Id: I327920ff06efd82e91b319b27319f41912169af1
user_space/swapout/swapout_copy_to_01.sh:
* Use ~/.mck_test_config
* Fix checking if McKernel version is written in swap-file
user_space/futex/futex_test.sh:
* Use ~/.mck_test_config
user_space/perf_event_open/perf_event_open_test.sh
* Use ~/.mck_test_config
Change-Id: Id93b207ed0e3e9ebf307073db81b40335bc5b140
Add new file with common functions for tests to use.
- loads config file
- checks for mcexec etc
- checks for LTP and OSTEST if required
- handle mcstop / mcreboot if required, and provide function for it
At the same time, make a few changes to mck_test_config:
- move to ~/.mck_test_config
- add boot params to the config, tests the require specific params can
overwite it
- make the config "set-if-variable-is-empty", so someone can overwrite
any param by setting the environment value e.g. LTP=.... ./test.sh
will use the value given
Change-Id: Ib04112043e3eb89615dc7afaa8842a98571fab93
This includes the following fix:
send_syscall, do_syscall: remove argument pid
Fujitsu: POSTK_TEMP_FIX_26
Refs: #1165
Change-Id: I702362c07a28f507a5e43dd751949aefa24bc8c0
It's enabled by adding -s to mcreboot.sh.
Cherry-pick of the following commit:
commit b5c13ce51a5a4926c2cf11c817cd0d369ac4402d
Author: Katsuya Horigome <katsuya.horigome.rj@ps.hitachi-solutions.com>
Date: Mon Nov 20 09:40:41 2017 +0900
Include measures to prevent memory destruction on Linux side (This is rebase commit for merging to development+hfi)
Device map with MAP_PRIVATE is copied when forking using copy_user_pte.
So the map isn't copied by those statements.
Futjitsu: POSTK_TEMP_FIX_14
Refs: #1039
Change-Id: I1a697ed2e003055d66a8eebd3e8d5e9e49d094ad
(1) Check if rlim's address is valid
(2) Check if soft-limit does not exceed hard-limit
Fujitsu: POSTK_DEBUG_TEMP_FIX_3
Refs: #1050
Change-Id: I5bf1008ce172f9dff64ec89b1f97614926abaf13
(1) Check if size is large enough
(2) Check if size is positive
Fujitsu: POSTK_DEBUG_TEMP_FIX_5
Refs: #1121
Change-Id: I3e41720c89ef89294820f7f4fa8df1a69a7011b0