mmap/munmap /dev/zero
PATCH v11 1/1 mmap/munmap /dev/zero
In reply to a message not in the archiveThe basic purpose of this is a to test if it is possible to map and unmap /dev/zero, and to read and write the mapping. Being inspired by two bugs in the past, the design of the test was added some variations based on the reproducers for them. It also accept an option to mmap/munmap anonymous pages.
One is to trigger panic with transparent hugepage feature that split_huge_page is very strict in checking the rmap walk was perfect. Keep it strict because if page_mapcount isn't stable and just right, the __split_huge_page_refcount that follows the rmap walk could lead to erratic page_count()s for the subpages. The bug in fork lead to the rmap walk finding the parent huge-pmd twice instead of just one, because the anon_vma_chain objects of the child vma still point to the vma->vm_mm of the parent. That trips on the split_huge_page mapcount vs page_mapcount check leading to a BUG_ON.
The other bug is mmap() of /dev/zero results in calling map_zero() which on RHEL5 maps the ZERO_PAGE in every PTE within that virtual address range. Since the application which maps a region from 5M to 16M in size is also multi-threaded the subsequent munmap() of /dev/zero results is TLB shootdowns to all other CPUs. When this happens thousands or millions of times the application performance is terrible. The mapping ZERO_PAGE in every pte within that virtual address range was an optimization to make the subsequent pagefault times faster on RHEL5 that has been removed/changed upstream.
---
v11: more code cleanup
v10: code cleanup
v9: add the tests to runtest/mm.
v8: add an option to utilize KSM; no need to open /dev/zero for
anonymous page testing.
v7: another "(void)" fix
v6: really use git format; check return from children; cleanup.
v5: add an option to test anonymous pages; move open() into setup().
v4: comment fix; code cleanup.
v3: really mmap /dev/zero; replace _exit() with exit(); fix patch
format.
v2: incorporate comments from Mike and Garrett.
---
runtest/mm | 5 +
testcases/kernel/syscalls/mmap/mmap10.c | 179 +++++++++++++++++++++++++++++++
2 files changed, 184 insertions(+), 0 deletions(-)
create mode 100644 testcases/kernel/syscalls/mmap/mmap10.cruntest/mm +5 -0
@@ -54,3 +54,8 @@ mmapstress08 mmapstress08 mmapstress09 mmapstress09 -p 20 -t 0.2 mmapstress10 mmapstress10 -p 20 -t 0.2 +mmap10 mmap10 +mmap10_1 mmap10 -a +mmap10_2 mmap10 -s +mmap10_3 mmap10 -a -s +mmap10_4 mmap10 -a -s -c 60
testcases/kernel/syscalls/mmap/mmap10.c new file +179 -0
179 lines not on this page · raw message
Signature · 12 lines
1.7.3.2 ------------------------------------------------------------------------------ What happens now with your Lotus Notes apps - do you make another costly upgrade, or settle for being marooned without product support? Time to move off Lotus Notes and onto the cloud with Force.com, apps are easier to build, use, and manage than apps on traditional platforms. Sign up for the Lotus Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list