From: Caspar Z. <su...@li...> - 2012-03-12 07:10:23
|
The branch, master, has been updated via 79667facbd7a489bad97dcda1e2d319ee2a7a70e (commit) via 7668f7e4005085cc479eb5dc7f6f241dbc8e2dbc (commit) via 8d9c084e1770f2719ef99a79416584c945cc775f (commit) from a4bf00362a279d6799fc0d53de8e41b4704e9b44 (commit) - Log ----------------------------------------------------------------- commit 79667facbd7a489bad97dcda1e2d319ee2a7a70e Author: Caspar Zhang <ca...@ca...> Date: Mon Mar 12 14:41:46 2012 +0800 mm: cleanup headers This patch does some clean-ups under mem/ dir: 1) change #include "../include/mem.h" to #include "mem.h" 2) sort all headers properly Signed-off-by: Caspar Zhang <ca...@ca...> Tested-by: Caspar Zhang <ca...@ca...> commit 7668f7e4005085cc479eb5dc7f6f241dbc8e2dbc Author: Caspar Zhang <ca...@ca...> Date: Tue Oct 18 19:02:19 2011 +0800 mm/swapping01: new testcase swapping01 - first time swap use results in heavy swapping This case is used for testing upstream commit: 50a1598. The upstream commit fixed a issue on s390/x platform that heavy swapping might occur in some condition, however since the patch was quite general, this testcase will be run on all supported platforms to ensure no regression been introduced. Details of the upstream fix: On x86 a page without a mapper is by definition not referenced / old. The s390 architecture keeps the reference bit in the storage key and the current code will check the storage key for page without a mapper. This leads to an interesting effect: the first time an s390 system needs to write pages to swap it only finds referenced pages. This causes a lot of pages to get added and written to the swap device. To avoid this behaviour change page_referenced to query the storage key only if there is a mapper of the page. Test Strategy: Try to allocate memory which size is slightly larger than current available memory. After allocation done, continue loop for a while and calculate the used swap size. The used swap size should be small enough, else it indicates that heavy swapping is occured unexpectedly. Signed-off-by: Caspar Zhang <ca...@ca...> Reviewed-by: Wanlong Gao <gao...@cn...> commit 8d9c084e1770f2719ef99a79416584c945cc775f Author: Wanlong Gao <gao...@cn...> Date: Fri Mar 9 15:52:19 2012 +0800 move testfrmw to a common directory testfrmw has many dups, so move it to a common directory. Signed-off-by: Wanlong Gao <gao...@cn...> ----------------------------------------------------------------------- Summary of changes: runtest/mm | 2 + testcases/kernel/mem/cpuset/Makefile | 14 +- testcases/kernel/mem/cpuset/cpuset01.c | 36 +- testcases/kernel/mem/hugetlb/hugemmap/Makefile | 4 +- testcases/kernel/mem/hugetlb/hugemmap/hugemmap01.c | 20 +- testcases/kernel/mem/hugetlb/hugemmap/hugemmap02.c | 20 +- testcases/kernel/mem/hugetlb/hugemmap/hugemmap03.c | 20 +- testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c | 20 +- testcases/kernel/mem/ksm/Makefile | 3 +- testcases/kernel/mem/ksm/ksm01.c | 13 +- testcases/kernel/mem/ksm/ksm02.c | 24 +- testcases/kernel/mem/ksm/ksm03.c | 13 +- testcases/kernel/mem/ksm/ksm04.c | 24 +- testcases/kernel/mem/ksm/ksm05.c | 6 +- testcases/kernel/mem/lib/Makefile | 3 +- testcases/kernel/mem/lib/mem.c | 4 +- testcases/kernel/mem/oom/Makefile | 8 +- testcases/kernel/mem/oom/oom01.c | 4 +- testcases/kernel/mem/oom/oom02.c | 16 +- testcases/kernel/mem/oom/oom03.c | 4 +- testcases/kernel/mem/oom/oom04.c | 16 +- testcases/kernel/mem/{ksm => swapping}/Makefile | 3 +- testcases/kernel/mem/swapping/swapping01.c | 187 ++++++++ testcases/kernel/mem/thp/Makefile | 3 +- testcases/kernel/mem/thp/thp01.c | 1 - testcases/kernel/mem/thp/thp02.c | 4 +- testcases/kernel/mem/tunable/Makefile | 29 +- testcases/kernel/mem/tunable/max_map_count.c | 2 +- testcases/kernel/mem/tunable/overcommit_memory.c | 2 +- testcases/kernel/mem/vma/vma02.c | 33 +- testcases/kernel/mem/vma/vma04.c | 3 +- testcases/kernel/mem/zram/zram01.c | 7 +- .../conformance/interfaces/fork/1-1.c | 4 +- .../conformance/interfaces/fork/11-1.c | 4 +- .../conformance/interfaces/fork/12-1.c | 4 +- .../conformance/interfaces/fork/13-1.c | 4 +- .../conformance/interfaces/fork/14-1.c | 4 +- .../conformance/interfaces/fork/16-1.c | 4 +- .../conformance/interfaces/fork/17-1.c | 4 +- .../conformance/interfaces/fork/17-2.c | 4 +- .../conformance/interfaces/fork/18-1.c | 4 +- .../conformance/interfaces/fork/2-1.c | 4 +- .../conformance/interfaces/fork/21-1.c | 4 +- .../conformance/interfaces/fork/22-1.c | 4 +- .../conformance/interfaces/fork/3-1.c | 4 +- .../conformance/interfaces/fork/4-1.c | 4 +- .../conformance/interfaces/fork/6-1.c | 4 +- .../conformance/interfaces/fork/7-1.c | 4 +- .../conformance/interfaces/fork/8-1.c | 4 +- .../conformance/interfaces/fork/9-1.c | 4 +- .../conformance/interfaces/fork/testfrmw.c | 64 --- .../conformance/interfaces/fork/testfrmw.h | 71 --- .../conformance/interfaces/getpid/1-1.c | 6 +- .../conformance/interfaces/getpid/testfrmw.c | 69 --- .../conformance/interfaces/getpid/testfrmw.h | 85 ---- .../conformance/interfaces/pthread_atfork/1-2.c | 6 +- .../conformance/interfaces/pthread_atfork/2-2.c | 6 +- .../conformance/interfaces/pthread_atfork/3-2.c | 6 +- .../conformance/interfaces/pthread_atfork/3-3.c | 6 +- .../conformance/interfaces/pthread_atfork/4-1.c | 6 +- .../interfaces/pthread_atfork/testfrmw.c | 69 --- .../interfaces/pthread_atfork/testfrmw.h | 85 ---- .../interfaces/pthread_cond_broadcast/1-2.c | 4 +- .../interfaces/pthread_cond_broadcast/2-3.c | 4 +- .../interfaces/pthread_cond_broadcast/4-2.c | 4 +- .../interfaces/pthread_cond_broadcast/testfrmw.c | 69 --- .../interfaces/pthread_cond_broadcast/testfrmw.h | 85 ---- .../interfaces/pthread_cond_destroy/2-1.c | 4 +- .../interfaces/pthread_cond_destroy/testfrmw.c | 69 --- .../interfaces/pthread_cond_destroy/testfrmw.h | 85 ---- .../interfaces/pthread_cond_signal/1-2.c | 4 +- .../interfaces/pthread_cond_signal/4-2.c | 4 +- .../interfaces/pthread_cond_signal/testfrmw.c | 69 --- .../interfaces/pthread_cond_signal/testfrmw.h | 85 ---- .../interfaces/pthread_cond_timedwait/2-4.c | 4 +- .../interfaces/pthread_cond_timedwait/2-5.c | 4 +- .../interfaces/pthread_cond_timedwait/2-6.c | 4 +- .../interfaces/pthread_cond_timedwait/2-7.c | 4 +- .../interfaces/pthread_cond_timedwait/4-2.c | 4 +- .../interfaces/pthread_cond_timedwait/4-3.c | 4 +- .../interfaces/pthread_cond_timedwait/testfrmw.c | 56 --- .../interfaces/pthread_cond_timedwait/testfrmw.h | 85 ---- .../conformance/interfaces/pthread_cond_wait/2-2.c | 4 +- .../conformance/interfaces/pthread_cond_wait/2-3.c | 4 +- .../conformance/interfaces/pthread_cond_wait/4-1.c | 4 +- .../interfaces/pthread_cond_wait/testfrmw.c | 69 --- .../interfaces/pthread_cond_wait/testfrmw.h | 85 ---- .../conformance/interfaces/pthread_create/1-4.c | 6 +- .../conformance/interfaces/pthread_create/1-5.c | 6 +- .../conformance/interfaces/pthread_create/1-6.c | 6 +- .../conformance/interfaces/pthread_create/14-1.c | 6 +- .../interfaces/pthread_create/15-1-buildonly.c | 6 +- .../conformance/interfaces/pthread_create/3-2.c | 6 +- .../conformance/interfaces/pthread_create/8-2.c | 6 +- .../interfaces/pthread_create/testfrmw.c | 71 --- .../interfaces/pthread_create/testfrmw.h | 85 ---- .../interfaces/pthread_create/threads_scenarii.c | 420 ----------------- .../conformance/interfaces/pthread_detach/1-2.c | 8 +- .../conformance/interfaces/pthread_detach/2-2.c | 8 +- .../conformance/interfaces/pthread_detach/4-3.c | 6 +- .../conformance/interfaces/pthread_equal/2-1.c | 4 +- .../interfaces/pthread_equal/testfrmw.c | 69 --- .../interfaces/pthread_equal/testfrmw.h | 85 ---- .../conformance/interfaces/pthread_exit/1-2.c | 6 +- .../conformance/interfaces/pthread_exit/2-2.c | 6 +- .../conformance/interfaces/pthread_exit/3-2.c | 6 +- .../conformance/interfaces/pthread_exit/4-1.c | 6 +- .../conformance/interfaces/pthread_exit/5-1.c | 6 +- .../conformance/interfaces/pthread_exit/6-1.c | 6 +- .../conformance/interfaces/pthread_exit/6-2.c | 6 +- .../conformance/interfaces/pthread_exit/testfrmw.c | 69 --- .../conformance/interfaces/pthread_exit/testfrmw.h | 85 ---- .../interfaces/pthread_exit/threads_scenarii.c | 422 ----------------- .../conformance/interfaces/pthread_join/1-2.c | 9 +- .../conformance/interfaces/pthread_join/4-1.c | 9 +- .../conformance/interfaces/pthread_join/6-3.c | 8 +- .../conformance/interfaces/pthread_join/testfrmw.c | 69 --- .../conformance/interfaces/pthread_join/testfrmw.h | 85 ---- .../interfaces/pthread_join/threads_scenarii.c | 485 -------------------- .../conformance/interfaces/pthread_kill/1-2.c | 4 +- .../conformance/interfaces/pthread_kill/8-1.c | 4 +- .../conformance/interfaces/pthread_kill/testfrmw.c | 69 --- .../conformance/interfaces/pthread_kill/testfrmw.h | 85 ---- .../interfaces/pthread_mutex_destroy/2-2.c | 6 +- .../interfaces/pthread_mutex_destroy/5-2.c | 6 +- .../interfaces/pthread_mutex_destroy/testfrmw.c | 69 --- .../interfaces/pthread_mutex_destroy/testfrmw.h | 85 ---- .../interfaces/pthread_mutex_init/1-2.c | 4 +- .../interfaces/pthread_mutex_init/3-2.c | 4 +- .../interfaces/pthread_mutex_init/5-1.c | 4 +- .../pthread_mutex_init/speculative/5-2.c | 6 +- .../interfaces/pthread_mutex_init/testfrmw.c | 56 --- .../interfaces/pthread_mutex_init/testfrmw.h | 82 ---- .../interfaces/pthread_mutex_lock/3-1.c | 4 +- .../interfaces/pthread_mutex_lock/4-1.c | 6 +- .../interfaces/pthread_mutex_lock/5-1.c | 6 +- .../interfaces/pthread_mutex_lock/testfrmw.c | 56 --- .../interfaces/pthread_mutex_lock/testfrmw.h | 82 ---- .../interfaces/pthread_mutex_trylock/1-2.c | 4 +- .../interfaces/pthread_mutex_trylock/2-1.c | 4 +- .../interfaces/pthread_mutex_trylock/4-2.c | 4 +- .../interfaces/pthread_mutex_trylock/4-3.c | 4 +- .../interfaces/pthread_mutex_trylock/testfrmw.c | 69 --- .../interfaces/pthread_mutex_trylock/testfrmw.h | 85 ---- .../interfaces/pthread_mutex_unlock/5-1.c | 4 +- .../interfaces/pthread_mutex_unlock/5-2.c | 4 +- .../interfaces/pthread_mutex_unlock/testfrmw.c | 56 --- .../interfaces/pthread_mutex_unlock/testfrmw.h | 82 ---- .../conformance/interfaces/pthread_once/1-2.c | 4 +- .../conformance/interfaces/pthread_once/1-3.c | 4 +- .../conformance/interfaces/pthread_once/2-1.c | 4 +- .../conformance/interfaces/pthread_once/6-1.c | 4 +- .../conformance/interfaces/pthread_once/testfrmw.c | 69 --- .../conformance/interfaces/pthread_once/testfrmw.h | 85 ---- .../interfaces/pthread_setschedparam/1-2.c | 4 +- .../interfaces/pthread_setschedparam/4-1.c | 4 +- .../interfaces/pthread_setschedparam/5-1.c | 4 +- .../interfaces/pthread_setschedparam/testfrmw.c | 69 --- .../interfaces/pthread_setschedparam/testfrmw.h | 85 ---- .../conformance/interfaces/pthread_sigmask/18-1.c | 4 +- .../interfaces/pthread_sigmask/testfrmw.c | 69 --- .../interfaces/pthread_sigmask/testfrmw.h | 85 ---- .../conformance/interfaces/sem_close/3-2.c | 4 +- .../conformance/interfaces/sem_close/testfrmw.c | 69 --- .../conformance/interfaces/sem_close/testfrmw.h | 85 ---- .../conformance/interfaces/sem_getvalue/2-2.c | 4 +- .../conformance/interfaces/sem_getvalue/testfrmw.c | 69 --- .../conformance/interfaces/sem_getvalue/testfrmw.h | 85 ---- .../conformance/interfaces/sem_init/3-2.c | 4 +- .../conformance/interfaces/sem_init/3-3.c | 4 +- .../conformance/interfaces/sem_init/7-1.c | 4 +- .../conformance/interfaces/sem_init/testfrmw.c | 69 --- .../conformance/interfaces/sem_init/testfrmw.h | 85 ---- .../conformance/interfaces/sem_open/15-1.c | 4 +- .../conformance/interfaces/sem_open/testfrmw.c | 69 --- .../conformance/interfaces/sem_open/testfrmw.h | 85 ---- .../conformance/interfaces/sem_unlink/2-2.c | 4 +- .../conformance/interfaces/sem_unlink/3-1.c | 4 +- .../conformance/interfaces/sem_unlink/4-2.c | 4 +- .../conformance/interfaces/sem_unlink/5-1.c | 4 +- .../conformance/interfaces/sem_unlink/6-1.c | 4 +- .../conformance/interfaces/sem_unlink/7-1.c | 4 +- .../conformance/interfaces/sem_unlink/9-1.c | 4 +- .../conformance/interfaces/sem_unlink/testfrmw.c | 69 --- .../conformance/interfaces/sem_unlink/testfrmw.h | 85 ---- .../conformance/interfaces/sem_wait/13-1.c | 4 +- .../conformance/interfaces/sem_wait/testfrmw.c | 69 --- .../conformance/interfaces/sem_wait/testfrmw.h | 85 ---- .../conformance/interfaces/sigaction/18-1.c | 4 +- .../conformance/interfaces/sigaction/18-10.c | 4 +- .../conformance/interfaces/sigaction/18-11.c | 4 +- .../conformance/interfaces/sigaction/18-12.c | 4 +- .../conformance/interfaces/sigaction/18-13.c | 4 +- .../conformance/interfaces/sigaction/18-14.c | 4 +- .../conformance/interfaces/sigaction/18-15.c | 4 +- .../conformance/interfaces/sigaction/18-16.c | 4 +- .../conformance/interfaces/sigaction/18-17.c | 4 +- .../conformance/interfaces/sigaction/18-18.c | 4 +- .../conformance/interfaces/sigaction/18-19.c | 4 +- .../conformance/interfaces/sigaction/18-2.c | 4 +- .../conformance/interfaces/sigaction/18-20.c | 4 +- .../conformance/interfaces/sigaction/18-21.c | 4 +- .../conformance/interfaces/sigaction/18-22.c | 4 +- .../conformance/interfaces/sigaction/18-23.c | 4 +- .../conformance/interfaces/sigaction/18-24.c | 4 +- .../conformance/interfaces/sigaction/18-25.c | 4 +- .../conformance/interfaces/sigaction/18-26.c | 4 +- .../conformance/interfaces/sigaction/18-3.c | 4 +- .../conformance/interfaces/sigaction/18-4.c | 4 +- .../conformance/interfaces/sigaction/18-5.c | 4 +- .../conformance/interfaces/sigaction/18-6.c | 4 +- .../conformance/interfaces/sigaction/18-7.c | 4 +- .../conformance/interfaces/sigaction/18-8.c | 4 +- .../conformance/interfaces/sigaction/18-9.c | 4 +- .../conformance/interfaces/sigaction/19-1.c | 4 +- .../conformance/interfaces/sigaction/19-10.c | 4 +- .../conformance/interfaces/sigaction/19-11.c | 4 +- .../conformance/interfaces/sigaction/19-12.c | 4 +- .../conformance/interfaces/sigaction/19-13.c | 4 +- .../conformance/interfaces/sigaction/19-14.c | 4 +- .../conformance/interfaces/sigaction/19-15.c | 4 +- .../conformance/interfaces/sigaction/19-16.c | 4 +- .../conformance/interfaces/sigaction/19-17.c | 4 +- .../conformance/interfaces/sigaction/19-18.c | 4 +- .../conformance/interfaces/sigaction/19-19.c | 4 +- .../conformance/interfaces/sigaction/19-2.c | 4 +- .../conformance/interfaces/sigaction/19-20.c | 4 +- .../conformance/interfaces/sigaction/19-21.c | 4 +- .../conformance/interfaces/sigaction/19-22.c | 4 +- .../conformance/interfaces/sigaction/19-23.c | 4 +- .../conformance/interfaces/sigaction/19-24.c | 4 +- .../conformance/interfaces/sigaction/19-25.c | 4 +- .../conformance/interfaces/sigaction/19-26.c | 4 +- .../conformance/interfaces/sigaction/19-3.c | 4 +- .../conformance/interfaces/sigaction/19-4.c | 4 +- .../conformance/interfaces/sigaction/19-5.c | 4 +- .../conformance/interfaces/sigaction/19-6.c | 4 +- .../conformance/interfaces/sigaction/19-7.c | 4 +- .../conformance/interfaces/sigaction/19-8.c | 4 +- .../conformance/interfaces/sigaction/19-9.c | 4 +- .../conformance/interfaces/sigaction/23-1.c | 4 +- .../conformance/interfaces/sigaction/23-10.c | 4 +- .../conformance/interfaces/sigaction/23-11.c | 4 +- .../conformance/interfaces/sigaction/23-12.c | 4 +- .../conformance/interfaces/sigaction/23-13.c | 4 +- .../conformance/interfaces/sigaction/23-14.c | 4 +- .../conformance/interfaces/sigaction/23-15.c | 4 +- .../conformance/interfaces/sigaction/23-16.c | 4 +- .../conformance/interfaces/sigaction/23-17.c | 4 +- .../conformance/interfaces/sigaction/23-18.c | 4 +- .../conformance/interfaces/sigaction/23-19.c | 4 +- .../conformance/interfaces/sigaction/23-2.c | 4 +- .../conformance/interfaces/sigaction/23-20.c | 4 +- .../conformance/interfaces/sigaction/23-21.c | 4 +- .../conformance/interfaces/sigaction/23-22.c | 4 +- .../conformance/interfaces/sigaction/23-23.c | 4 +- .../conformance/interfaces/sigaction/23-24.c | 4 +- .../conformance/interfaces/sigaction/23-25.c | 4 +- .../conformance/interfaces/sigaction/23-26.c | 4 +- .../conformance/interfaces/sigaction/23-3.c | 4 +- .../conformance/interfaces/sigaction/23-4.c | 4 +- .../conformance/interfaces/sigaction/23-5.c | 4 +- .../conformance/interfaces/sigaction/23-6.c | 4 +- .../conformance/interfaces/sigaction/23-7.c | 4 +- .../conformance/interfaces/sigaction/23-8.c | 4 +- .../conformance/interfaces/sigaction/23-9.c | 4 +- .../conformance/interfaces/sigaction/29-1.c | 4 +- .../conformance/interfaces/sigaction/30-1.c | 4 +- .../conformance/interfaces/sigaction/testfrmw.c | 69 --- .../conformance/interfaces/sigaction/testfrmw.h | 85 ---- .../conformance/interfaces/sigwait/6-1.c | 4 +- .../conformance/interfaces/sigwait/6-2.c | 4 +- .../conformance/interfaces/sigwait/7-1.c | 4 +- .../conformance/interfaces/sigwait/testfrmw.c | 69 --- .../conformance/interfaces/sigwait/testfrmw.h | 85 ---- .../{pthread_detach => testfrmw}/testfrmw.c | 0 .../{pthread_detach => testfrmw}/testfrmw.h | 0 .../threads_scenarii.c | 0 278 files changed, 777 insertions(+), 6288 deletions(-) copy testcases/kernel/mem/{ksm => swapping}/Makefile (95%) create mode 100644 testcases/kernel/mem/swapping/swapping01.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/fork/testfrmw.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/fork/testfrmw.h delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/getpid/testfrmw.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/getpid/testfrmw.h delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/testfrmw.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/testfrmw.h delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/testfrmw.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/testfrmw.h delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_destroy/testfrmw.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_destroy/testfrmw.h delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/testfrmw.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/testfrmw.h delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/testfrmw.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/testfrmw.h delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/testfrmw.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/testfrmw.h delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_create/testfrmw.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_create/testfrmw.h delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_create/threads_scenarii.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_equal/testfrmw.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_equal/testfrmw.h delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/testfrmw.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/testfrmw.h delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/threads_scenarii.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_join/testfrmw.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_join/testfrmw.h delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_join/threads_scenarii.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/testfrmw.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/testfrmw.h delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/testfrmw.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/testfrmw.h delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/testfrmw.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/testfrmw.h delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/testfrmw.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/testfrmw.h delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/testfrmw.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/testfrmw.h delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/testfrmw.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/testfrmw.h delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_once/testfrmw.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_once/testfrmw.h delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedparam/testfrmw.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedparam/testfrmw.h delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/testfrmw.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/testfrmw.h delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sem_close/testfrmw.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sem_close/testfrmw.h delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sem_getvalue/testfrmw.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sem_getvalue/testfrmw.h delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sem_init/testfrmw.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sem_init/testfrmw.h delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sem_open/testfrmw.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sem_open/testfrmw.h delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/testfrmw.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/testfrmw.h delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sem_wait/testfrmw.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sem_wait/testfrmw.h delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sigaction/testfrmw.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sigaction/testfrmw.h delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sigwait/testfrmw.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sigwait/testfrmw.h rename testcases/open_posix_testsuite/conformance/interfaces/{pthread_detach => testfrmw}/testfrmw.c (100%) rename testcases/open_posix_testsuite/conformance/interfaces/{pthread_detach => testfrmw}/testfrmw.h (100%) rename testcases/open_posix_testsuite/conformance/interfaces/{pthread_detach => testfrmw}/threads_scenarii.c (100%) diff --git a/runtest/mm b/runtest/mm index 245e50d..be3b342 100644 --- a/runtest/mm +++ b/runtest/mm @@ -78,6 +78,8 @@ oom02 oom02 oom03 oom03 oom04 oom04 +swapping01 swapping01 -i 5 + thp01 thp01 -I 120 thp02 thp02 diff --git a/testcases/kernel/mem/cpuset/Makefile b/testcases/kernel/mem/cpuset/Makefile index 29c9b62..f0c34ba 100644 --- a/testcases/kernel/mem/cpuset/Makefile +++ b/testcases/kernel/mem/cpuset/Makefile @@ -17,15 +17,16 @@ # 02110-1301, USA. # -top_srcdir ?= ../../../.. +top_srcdir ?= ../../../.. -include $(top_srcdir)/include/mk/env_pre.mk +include $(top_srcdir)/include/mk/testcases.mk -LDLIBS += $(NUMA_LIBS) -lmem -lm +LDLIBS += $(NUMA_LIBS) -lmem -lltp -lm LIBDIR := ../lib LIB := $(LIBDIR)/libmem.a -FILTER_OUT_DIRS := $(LIBDIR) -LDFLAGS += -L$(LIBDIR) +FILTER_OUT_DIRS := $(LIBDIR) +CFLAGS += -I../include +LDFLAGS += -L$(LIBDIR) $(LIBDIR): mkdir -p "$@" @@ -33,7 +34,7 @@ $(LIBDIR): $(LIB): $(LIBDIR) $(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" all -MAKE_DEPS := $(LIB) +MAKE_DEPS := $(LIB) trunk-clean:: | lib-clean @@ -41,4 +42,3 @@ lib-clean:: $(LIBDIR) $(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" clean include $(top_srcdir)/include/mk/generic_leaf_target.mk -include $(top_srcdir)/include/mk/testcases.mk diff --git a/testcases/kernel/mem/cpuset/cpuset01.c b/testcases/kernel/mem/cpuset/cpuset01.c index e4adc78..09159f2 100644 --- a/testcases/kernel/mem/cpuset/cpuset01.c +++ b/testcases/kernel/mem/cpuset/cpuset01.c @@ -28,33 +28,35 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ -#include "test.h" -#include "usctest.h" #include "config.h" -#include "../include/mem.h" - -char *TCID = "cpuset01"; -int TST_TOTAL = 1; - -#if HAVE_NUMA_H && HAVE_LINUX_MEMPOLICY_H && HAVE_NUMAIF_H \ - && HAVE_MPOL_CONSTANTS #include <sys/types.h> -#include <sys/stat.h> -#include <sys/wait.h> #include <sys/mman.h> #include <sys/mount.h> -#include <numaif.h> -#include <errno.h> -#include <unistd.h> -#include <stdlib.h> -#include <stdio.h> -#include <fcntl.h> +#include <sys/stat.h> +#include <sys/wait.h> #include <ctype.h> #include <err.h> +#include <errno.h> +#include <fcntl.h> #include <math.h> +#if HAVE_NUMAIF_H +#include <numaif.h> +#endif #include <signal.h> #include <stdarg.h> +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include "test.h" +#include "usctest.h" +#include "mem.h" + +char *TCID = "cpuset01"; +int TST_TOTAL = 1; + +#if HAVE_NUMA_H && HAVE_LINUX_MEMPOLICY_H && HAVE_NUMAIF_H \ + && HAVE_MPOL_CONSTANTS volatile int end; static long nodes[MAXNODES]; static long nnodes; diff --git a/testcases/kernel/mem/hugetlb/hugemmap/Makefile b/testcases/kernel/mem/hugetlb/hugemmap/Makefile index ae59f44..601755a 100644 --- a/testcases/kernel/mem/hugetlb/hugemmap/Makefile +++ b/testcases/kernel/mem/hugetlb/hugemmap/Makefile @@ -20,7 +20,7 @@ # Garrett Cooper, July 2009 # -top_srcdir ?= ../../../../.. +top_srcdir ?= ../../../../.. include $(top_srcdir)/include/mk/testcases.mk include $(abs_srcdir)/../Makefile.inc @@ -30,7 +30,7 @@ LIBMEM := $(LIBMEMDIR)/libmem.a $(LIBMEM): $(LIBMEMDIR) $(MAKE) -C "$^" -f "$(abs_srcdir)/$^/Makefile" all -CPPFLAGS += -I$(abs_srcdir)/$(LIBMEMDIR) +CPPFLAGS += -I$(abs_srcdir)/$(LIBMEMDIR) -I$(abs_srcdir)/../../include LDFLAGS += -L$(abs_builddir)/$(LIBMEMDIR) LDLIBS += $(NUMA_LIBS) -lmem -lltp MAKE_DEPS += $(LIBMEM) diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap01.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap01.c index d3cb9ec..90f28c8 100644 --- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap01.c +++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap01.c @@ -46,24 +46,24 @@ * 04/2004 Written by Robbie Williamson */ -#include <stdio.h> -#include <stdlib.h> +#include <sys/types.h> +#include <sys/mman.h> +#include <sys/mount.h> +#include <sys/stat.h> #include <errno.h> -#include <unistd.h> #include <fcntl.h> -#include <string.h> #include <signal.h> #include <stdint.h> -#include <sys/stat.h> -#include <sys/mman.h> -#include <sys/types.h> -#include <sys/mount.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> #include "test.h" #include "usctest.h" -#include "system_specific_hugepages_info.h" -#include "../../include/mem.h" #include "safe_macros.h" +#include "system_specific_hugepages_info.h" +#include "mem.h" static char TEMPFILE[MAXPATHLEN]; diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap02.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap02.c index 062883b..5a96146 100644 --- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap02.c +++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap02.c @@ -39,24 +39,24 @@ * 04/2004 Written by Robbie Williamson */ -#include <stdio.h> -#include <stdlib.h> +#include <sys/types.h> +#include <sys/mman.h> +#include <sys/mount.h> +#include <sys/stat.h> #include <errno.h> -#include <unistd.h> #include <fcntl.h> -#include <string.h> #include <signal.h> #include <stdint.h> -#include <sys/stat.h> -#include <sys/mman.h> -#include <sys/types.h> -#include <sys/mount.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> #include "test.h" #include "usctest.h" -#include "system_specific_hugepages_info.h" -#include "../../include/mem.h" #include "safe_macros.h" +#include "system_specific_hugepages_info.h" +#include "mem.h" #define LOW_ADDR (void *)(0x80000000) #define LOW_ADDR2 (void *)(0x90000000) diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap03.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap03.c index f81d7ac..50fe707 100644 --- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap03.c +++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap03.c @@ -30,24 +30,24 @@ * Must be compiled in 64-bit mode. */ -#include <stdio.h> -#include <stdlib.h> +#include <sys/types.h> +#include <sys/mman.h> +#include <sys/mount.h> +#include <sys/stat.h> #include <errno.h> -#include <unistd.h> #include <fcntl.h> -#include <string.h> #include <signal.h> #include <stdint.h> -#include <sys/stat.h> -#include <sys/mman.h> -#include <sys/types.h> -#include <sys/mount.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> #include "test.h" #include "usctest.h" -#include "system_specific_hugepages_info.h" -#include "../../include/mem.h" #include "safe_macros.h" +#include "system_specific_hugepages_info.h" +#include "mem.h" #define HIGH_ADDR (void *)(0x1000000000000) diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c index c28d5de..8e5c4b8 100644 --- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c +++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c @@ -47,24 +47,24 @@ * 04/2004 Written by Robbie Williamson */ -#include <stdio.h> -#include <stdlib.h> +#include <sys/types.h> +#include <sys/mman.h> +#include <sys/mount.h> +#include <sys/stat.h> #include <errno.h> -#include <unistd.h> #include <fcntl.h> -#include <string.h> #include <signal.h> #include <stdint.h> -#include <sys/stat.h> -#include <sys/mman.h> -#include <sys/types.h> -#include <sys/mount.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> #include "test.h" #include "usctest.h" -#include "system_specific_hugepages_info.h" -#include "../../include/mem.h" #include "safe_macros.h" +#include "system_specific_hugepages_info.h" +#include "mem.h" static char TEMPFILE[MAXPATHLEN]; diff --git a/testcases/kernel/mem/ksm/Makefile b/testcases/kernel/mem/ksm/Makefile index b388170..c8e064c 100644 --- a/testcases/kernel/mem/ksm/Makefile +++ b/testcases/kernel/mem/ksm/Makefile @@ -16,7 +16,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -top_srcdir ?= ../../../.. +top_srcdir ?= ../../../.. include $(top_srcdir)/include/mk/testcases.mk @@ -24,6 +24,7 @@ LDLIBS += $(NUMA_LIBS) -lmem -lltp LIBDIR := ../lib LIB := $(LIBDIR)/libmem.a FILTER_OUT_DIRS := $(LIBDIR) +CFLAGS += -I../include LDFLAGS += -L$(LIBDIR) $(LIBDIR): diff --git a/testcases/kernel/mem/ksm/ksm01.c b/testcases/kernel/mem/ksm/ksm01.c index 407e7d8..795d5d8 100644 --- a/testcases/kernel/mem/ksm/ksm01.c +++ b/testcases/kernel/mem/ksm/ksm01.c @@ -54,22 +54,21 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ -#include <sys/stat.h> -#include <sys/mman.h> -#include <sys/types.h> -#include <sys/wait.h> + #include <sys/types.h> +#include <sys/mman.h> #include <sys/stat.h> +#include <sys/wait.h> +#include <errno.h> #include <fcntl.h> #include <signal.h> +#include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> -#include <stdio.h> -#include <errno.h> #include "test.h" #include "usctest.h" -#include "../include/mem.h" +#include "mem.h" char *TCID = "ksm01"; int TST_TOTAL = 1; diff --git a/testcases/kernel/mem/ksm/ksm02.c b/testcases/kernel/mem/ksm/ksm02.c index 7bed72b..3bfcaa6 100644 --- a/testcases/kernel/mem/ksm/ksm02.c +++ b/testcases/kernel/mem/ksm/ksm02.c @@ -54,25 +54,27 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ + +#include "config.h" +#include <sys/types.h> +#include <sys/stat.h> +#include <errno.h> +#include <fcntl.h> +#if HAVE_NUMAIF_H +#include <numaif.h> +#endif +#include <signal.h> +#include <stdio.h> +#include <unistd.h> #include "test.h" #include "usctest.h" -#include "config.h" +#include "mem.h" char *TCID = "ksm02"; int TST_TOTAL = 1; #if HAVE_NUMA_H && HAVE_LINUX_MEMPOLICY_H && HAVE_NUMAIF_H \ && HAVE_MPOL_CONSTANTS -#include <sys/stat.h> -#include <sys/types.h> -#include <fcntl.h> -#include <signal.h> -#include <unistd.h> -#include <stdio.h> -#include <errno.h> -#include <numaif.h> -#include "../include/mem.h" - option_t ksm_options[] = { { "n:", &opt_num, &opt_numstr}, { "s:", &opt_size, &opt_sizestr}, diff --git a/testcases/kernel/mem/ksm/ksm03.c b/testcases/kernel/mem/ksm/ksm03.c index fff6423..6984a9a 100644 --- a/testcases/kernel/mem/ksm/ksm03.c +++ b/testcases/kernel/mem/ksm/ksm03.c @@ -54,22 +54,21 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ -#include <sys/stat.h> -#include <sys/mman.h> -#include <sys/types.h> -#include <sys/wait.h> + #include <sys/types.h> +#include <sys/mman.h> #include <sys/stat.h> +#include <sys/wait.h> +#include <errno.h> #include <fcntl.h> #include <signal.h> +#include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> -#include <stdio.h> -#include <errno.h> #include "test.h" #include "usctest.h" -#include "../include/mem.h" +#include "mem.h" char *TCID = "ksm03"; int TST_TOTAL = 1; diff --git a/testcases/kernel/mem/ksm/ksm04.c b/testcases/kernel/mem/ksm/ksm04.c index 2f97712..8bbf067 100644 --- a/testcases/kernel/mem/ksm/ksm04.c +++ b/testcases/kernel/mem/ksm/ksm04.c @@ -54,25 +54,27 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ + +#include "config.h" +#include <sys/types.h> +#include <sys/stat.h> +#include <errno.h> +#include <fcntl.h> +#if HAVE_NUMAIF_H +#include <numaif.h> +#endif +#include <signal.h> +#include <stdio.h> +#include <unistd.h> #include "test.h" #include "usctest.h" -#include "config.h" +#include "mem.h" char *TCID = "ksm04"; int TST_TOTAL = 1; #if HAVE_NUMA_H && HAVE_LINUX_MEMPOLICY_H && HAVE_NUMAIF_H \ && HAVE_MPOL_CONSTANTS -#include <sys/stat.h> -#include <sys/types.h> -#include <fcntl.h> -#include <signal.h> -#include <unistd.h> -#include <stdio.h> -#include <errno.h> -#include <numaif.h> -#include "../include/mem.h" - option_t ksm_options[] = { { "n:", &opt_num, &opt_numstr}, { "s:", &opt_size, &opt_sizestr}, diff --git a/testcases/kernel/mem/ksm/ksm05.c b/testcases/kernel/mem/ksm/ksm05.c index f7d246f..4173a60 100644 --- a/testcases/kernel/mem/ksm/ksm05.c +++ b/testcases/kernel/mem/ksm/ksm05.c @@ -52,21 +52,21 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ + #include <sys/types.h> #include <sys/mman.h> #include <sys/stat.h> #include <sys/wait.h> #include <errno.h> #include <fcntl.h> -#include <unistd.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> - +#include <unistd.h> #include "test.h" #include "usctest.h" -#include "../include/mem.h" +#include "mem.h" char *TCID = "ksm05"; int TST_TOTAL = 1; diff --git a/testcases/kernel/mem/lib/Makefile b/testcases/kernel/mem/lib/Makefile index dd978a7..b22b1dd 100644 --- a/testcases/kernel/mem/lib/Makefile +++ b/testcases/kernel/mem/lib/Makefile @@ -16,10 +16,11 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -top_srcdir ?= ../../../.. +top_srcdir ?= ../../../.. include $(top_srcdir)/include/mk/env_pre.mk +CFLAGS := -I../include LIB := libmem.a include $(top_srcdir)/include/mk/lib.mk diff --git a/testcases/kernel/mem/lib/mem.c b/testcases/kernel/mem/lib/mem.c index db7ab88..560c7f0 100644 --- a/testcases/kernel/mem/lib/mem.c +++ b/testcases/kernel/mem/lib/mem.c @@ -23,8 +23,8 @@ #include "test.h" #include "usctest.h" #include "safe_macros.h" -#include "../include/_private.h" -#include "../include/mem.h" +#include "_private.h" +#include "mem.h" /* OOM */ diff --git a/testcases/kernel/mem/oom/Makefile b/testcases/kernel/mem/oom/Makefile index 9da67a8..c8e064c 100644 --- a/testcases/kernel/mem/oom/Makefile +++ b/testcases/kernel/mem/oom/Makefile @@ -16,14 +16,15 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -top_srcdir ?= ../../../.. +top_srcdir ?= ../../../.. -include $(top_srcdir)/include/mk/env_pre.mk +include $(top_srcdir)/include/mk/testcases.mk -LDLIBS += $(NUMA_LIBS) -lmem +LDLIBS += $(NUMA_LIBS) -lmem -lltp LIBDIR := ../lib LIB := $(LIBDIR)/libmem.a FILTER_OUT_DIRS := $(LIBDIR) +CFLAGS += -I../include LDFLAGS += -L$(LIBDIR) $(LIBDIR): @@ -40,4 +41,3 @@ lib-clean:: $(LIBDIR) $(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" clean include $(top_srcdir)/include/mk/generic_leaf_target.mk -include $(top_srcdir)/include/mk/testcases.mk diff --git a/testcases/kernel/mem/oom/oom01.c b/testcases/kernel/mem/oom/oom01.c index 3eb47ed..25ab805 100644 --- a/testcases/kernel/mem/oom/oom01.c +++ b/testcases/kernel/mem/oom/oom01.c @@ -30,14 +30,14 @@ */ #include <sys/types.h> #include <sys/stat.h> +#include <errno.h> #include <fcntl.h> #include <stdio.h> -#include <errno.h> #include <stdlib.h> #include <unistd.h> #include "test.h" #include "usctest.h" -#include "../include/mem.h" +#include "mem.h" char *TCID = "oom01"; int TST_TOTAL = 1; diff --git a/testcases/kernel/mem/oom/oom02.c b/testcases/kernel/mem/oom/oom02.c index 19f5490..551aad5 100644 --- a/testcases/kernel/mem/oom/oom02.c +++ b/testcases/kernel/mem/oom/oom02.c @@ -28,22 +28,22 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ + +#include "config.h" +#include <sys/types.h> +#include <sys/stat.h> +#include <errno.h> +#include <fcntl.h> +#include <stdio.h> #include "test.h" #include "usctest.h" -#include "config.h" +#include "mem.h" char *TCID = "oom02"; int TST_TOTAL = 1; #if HAVE_NUMA_H && HAVE_LINUX_MEMPOLICY_H && HAVE_NUMAIF_H \ && HAVE_MPOL_CONSTANTS -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <stdio.h> -#include <errno.h> -#include "../include/mem.h" - int main(int argc, char *argv[]) { char *msg; diff --git a/testcases/kernel/mem/oom/oom03.c b/testcases/kernel/mem/oom/oom03.c index c08d44c..b90d4d7 100644 --- a/testcases/kernel/mem/oom/oom03.c +++ b/testcases/kernel/mem/oom/oom03.c @@ -30,12 +30,12 @@ */ #include <sys/types.h> #include <sys/stat.h> +#include <errno.h> #include <fcntl.h> #include <stdio.h> -#include <errno.h> #include "test.h" #include "usctest.h" -#include "../include/mem.h" +#include "mem.h" char *TCID = "oom03"; int TST_TOTAL = 1; diff --git a/testcases/kernel/mem/oom/oom04.c b/testcases/kernel/mem/oom/oom04.c index bedc229..fb35f96 100644 --- a/testcases/kernel/mem/oom/oom04.c +++ b/testcases/kernel/mem/oom/oom04.c @@ -28,22 +28,22 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ + +#include "config.h" +#include <sys/types.h> +#include <sys/stat.h> +#include <errno.h> +#include <fcntl.h> +#include <stdio.h> #include "test.h" #include "usctest.h" -#include "config.h" +#include "mem.h" char *TCID = "oom04"; int TST_TOTAL = 1; #if HAVE_NUMA_H && HAVE_LINUX_MEMPOLICY_H && HAVE_NUMAIF_H \ && HAVE_MPOL_CONSTANTS -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <stdio.h> -#include <errno.h> -#include "../include/mem.h" - int main(int argc, char *argv[]) { char *msg; diff --git a/testcases/kernel/mem/ksm/Makefile b/testcases/kernel/mem/swapping/Makefile similarity index 95% copy from testcases/kernel/mem/ksm/Makefile copy to testcases/kernel/mem/swapping/Makefile index b388170..c8e064c 100644 --- a/testcases/kernel/mem/ksm/Makefile +++ b/testcases/kernel/mem/swapping/Makefile @@ -16,7 +16,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -top_srcdir ?= ../../../.. +top_srcdir ?= ../../../.. include $(top_srcdir)/include/mk/testcases.mk @@ -24,6 +24,7 @@ LDLIBS += $(NUMA_LIBS) -lmem -lltp LIBDIR := ../lib LIB := $(LIBDIR)/libmem.a FILTER_OUT_DIRS := $(LIBDIR) +CFLAGS += -I../include LDFLAGS += -L$(LIBDIR) $(LIBDIR): diff --git a/testcases/kernel/mem/swapping/swapping01.c b/testcases/kernel/mem/swapping/swapping01.c new file mode 100644 index 0000000..24f031e --- /dev/null +++ b/testcases/kernel/mem/swapping/swapping01.c @@ -0,0 +1,187 @@ +/* + * Copyright (C) 2012 Red Hat, Inc. + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * Further, this software is distributed without any warranty that it + * is free of the rightful claim of any third person regarding + * infringement or the like. Any license provided herein, whether + * implied or otherwise, applies only to this software file. Patent + * licenses, if any, provided herein do not apply to combinations of + * this program with other software, or any other product whatsoever. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ +/* + * swapping01 - first time swap use results in heavy swapping + * + * This case is used for testing upstream commit: 50a1598 + * + * The upstream commit fixed a issue on s390/x platform that heavy + * swapping might occur in some condition, however since the patch + * was quite general, this testcase will be run on all supported + * platforms to ensure no regression been introduced. + * + * Details of the upstream fix: + * On x86 a page without a mapper is by definition not referenced / old. + * The s390 architecture keeps the reference bit in the storage key and + * the current code will check the storage key for page without a mapper. + * This leads to an interesting effect: the first time an s390 system + * needs to write pages to swap it only finds referenced pages. This + * causes a lot of pages to get added and written to the swap device. + * To avoid this behaviour change page_referenced to query the storage + * key only if there is a mapper of the page. + * + * Test Strategy: + * Try to allocate memory which size is slightly larger than current + * available memory. After allocation done, continue loop for a while + * and calculate the used swap size. The used swap size should be small + * enough, else it indicates that heavy swapping is occured unexpectedly. + */ + +#include <sys/types.h> +#include <sys/wait.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include "test.h" +#include "usctest.h" +#include "mem.h" + +char *TCID = "swapping01"; +int TST_TOTAL = 1; + +/* allow swapping 0.5 * phy_mem in maximum */ +#define COE_DELTA 0.5 +/* will try to alloc 1.3 * phy_mem */ +#define COE_SLIGHT_OVER 0.3 + +static void init_meminfo(void); +static void do_alloc(void); +static void check_swapping(void); + +static long mem_free_init; +static long swap_free_init; +static long mem_over; +static long mem_over_max; +static pid_t pid; + +int main(int argc, char *argv[]) +{ + int lc; + char *msg; + + msg = parse_opts(argc, argv, NULL, NULL); + if (msg != NULL) + tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); + +#if __WORDSIZE == 32 + tst_brkm(TCONF, NULL, "test is not designed for 32-bit system."); +#endif + + setup(); + + for (lc = 0; TEST_LOOPING(lc); lc++) { + Tst_count = 0; + + init_meminfo(); + + switch (pid = fork()) { + case -1: + tst_brkm(TBROK|TERRNO, cleanup, "fork"); + case 0: + do_alloc(); + exit(0); + default: + check_swapping(); + } + } + cleanup(); + tst_exit(); +} + +static void init_meminfo(void) +{ + swap_free_init = read_meminfo("SwapFree:"); + mem_free_init = read_meminfo("MemFree:"); + mem_over = mem_free_init * COE_SLIGHT_OVER; + mem_over_max = mem_free_init * COE_DELTA; + + /* at least 10MB free physical memory needed */ + if (mem_free_init < 10240) { + sleep(5); + if (mem_free_init < 10240) + tst_brkm(TCONF, cleanup, + "Not enough free memory to test."); + } + if (swap_free_init < mem_over) + tst_brkm(TCONF, cleanup, "Not enough swap space to test."); +} + +static void do_alloc(void) +{ + long mem_count; + void *s; + + tst_resm(TINFO, "free physical memory: %ld MB", mem_free_init / 1024); + mem_count = mem_free_init + mem_over; + tst_resm(TINFO, "try to allocate: %ld MB", mem_count / 1024); + s = malloc(mem_count * 1024); + if (s == NULL) + tst_brkm(TBROK|TERRNO, cleanup, "malloc"); + memset(s, 1, mem_count * 1024); + tst_resm(TINFO, "memory allocated: %ld MB", mem_count / 1024); + if (raise(SIGSTOP) == -1) + tst_brkm(TBROK|TERRNO, tst_exit, "kill"); + free(s); +} + +static void check_swapping(void) +{ + int status, i; + long swapped; + + /* wait child stop */ + if (waitpid(pid, &status, WUNTRACED) == -1) + tst_brkm(TBROK|TERRNO, cleanup, "waitpid"); + if (!WIFSTOPPED(status)) + tst_brkm(TBROK, cleanup, "child was not stopped."); + + /* Still occupying memory, loop for a while */ + for (i = 0; i < 10; i++) { + swapped = swap_free_init - read_meminfo("SwapFree:"); + if (swapped > mem_over_max) { + kill(pid, SIGCONT); + tst_brkm(TFAIL, cleanup, "heavy swapping detected: " + "%ld MB swapped.", swapped / 1024); + } + sleep(1); + } + tst_resm(TPASS, "no heavy swapping detected, %ld MB swapped.", + swapped / 1024); + kill(pid, SIGCONT); + /* wait child exit */ + if (waitpid(pid, &status, 0) == -1) + tst_brkm(TBROK|TERRNO, cleanup, "waitpid"); +} + +void setup(void) +{ + tst_sig(FORK, DEF_HANDLER, cleanup); + + TEST_PAUSE; +} + +void cleanup(void) +{ + TEST_CLEANUP; +} diff --git a/testcases/kernel/mem/thp/Makefile b/testcases/kernel/mem/thp/Makefile index 347f709..9eb197e 100644 --- a/testcases/kernel/mem/thp/Makefile +++ b/testcases/kernel/mem/thp/Makefile @@ -17,7 +17,7 @@ # 02110-1301, USA. # -top_srcdir ?= ../../../.. +top_srcdir ?= ../../../.. include $(top_srcdir)/include/mk/testcases.mk @@ -25,6 +25,7 @@ LDLIBS += $(NUMA_LIBS) -lmem -lltp LIBDIR := ../lib LIB := $(LIBDIR)/libmem.a FILTER_OUT_DIRS := $(LIBDIR) +CFLAGS += -I../include LDFLAGS += -L$(LIBDIR) $(LIBDIR): diff --git a/testcases/kernel/mem/thp/thp01.c b/testcases/kernel/mem/thp/thp01.c index 6c7cce3..dec6c24 100644 --- a/testcases/kernel/mem/thp/thp01.c +++ b/testcases/kernel/mem/thp/thp01.c @@ -44,7 +44,6 @@ #include <unistd.h> #include "test.h" #include "usctest.h" -#include "config.h" char *TCID = "thp01"; int TST_TOTAL = 1; diff --git a/testcases/kernel/mem/thp/thp02.c b/testcases/kernel/mem/thp/thp02.c index 1ce371c..590cc25 100644 --- a/testcases/kernel/mem/thp/thp02.c +++ b/testcases/kernel/mem/thp/thp02.c @@ -46,11 +46,11 @@ #include "config.h" #include <sys/types.h> #include <sys/mman.h> -#include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -#include "../include/mem.h" +#include <unistd.h> +#include "mem.h" char *TCID = "thp02"; int TST_TOTAL = 1; diff --git a/testcases/kernel/mem/tunable/Makefile b/testcases/kernel/mem/tunable/Makefile index 6919ee0..9eb197e 100644 --- a/testcases/kernel/mem/tunable/Makefile +++ b/testcases/kernel/mem/tunable/Makefile @@ -1,29 +1,31 @@ # -# Copyright (C) 2012 Red Hat, Inc. +# Copyright (C) 2011 Red Hat, Inc. # -# This program is free software; you can redistribute it and/or modify +# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. +# the Free Software Foundation; either version 2 of the License, or (at +# your option) any later version. # -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See -# the GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. # -top_srcdir ?= ../../../.. +top_srcdir ?= ../../../.. -include $(top_srcdir)/include/mk/env_pre.mk +include $(top_srcdir)/include/mk/testcases.mk -LDLIBS += $(NUMA_LIBS) -lmem +LDLIBS += $(NUMA_LIBS) -lmem -lltp LIBDIR := ../lib LIB := $(LIBDIR)/libmem.a FILTER_OUT_DIRS := $(LIBDIR) +CFLAGS += -I../include LDFLAGS += -L$(LIBDIR) $(LIBDIR): @@ -40,4 +42,3 @@ lib-clean:: $(LIBDIR) $(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" clean include $(top_srcdir)/include/mk/generic_leaf_target.mk -include $(top_srcdir)/include/mk/testcases.mk diff --git a/testcases/kernel/mem/tunable/max_map_count.c b/testcases/kernel/mem/tunable/max_map_count.c index c31d920..57ed2bd 100644 --- a/testcases/kernel/mem/tunable/max_map_count.c +++ b/testcases/kernel/mem/tunable/max_map_count.c @@ -73,7 +73,7 @@ #include <stdlib.h> #include "test.h" #include "usctest.h" -#include "../include/mem.h" +#include "mem.h" #define MAX_MAP_COUNT_DEFAULT 65530L diff --git a/testcases/kernel/mem/tunable/overcommit_memory.c b/testcases/kernel/mem/tunable/overcommit_memory.c index 9c91337..962d40e 100644 --- a/testcases/kernel/mem/tunable/overcommit_memory.c +++ b/testcases/kernel/mem/tunable/overcommit_memory.c @@ -82,7 +82,7 @@ #include "test.h" #include "safe_macros.h" #include "usctest.h" -#include "../include/mem.h" +#include "mem.h" #define DEFAULT_OVER_RATIO 50L #define EXPECT_PASS 0 diff --git a/testcases/kernel/mem/vma/vma02.c b/testcases/kernel/mem/vma/vma02.c index a1c8f24..f63bf77 100644 --- a/testcases/kernel/mem/vma/vma02.c +++ b/testcases/kernel/mem/vma/vma02.c @@ -27,26 +27,29 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ +#include "config.h" +#include <sys/types.h> +#include <sys/mman.h> +#include <errno.h> +#if HAVE_NUMA_H +#include <numa.h> +#endif +#if HAVE_NUMAIF_H +#include <numaif.h> +#endif +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> #include "test.h" #include "usctest.h" -#include "config.h" char *TCID = "vma02"; int TST_TOTAL = 1; #if HAVE_NUMA_H && HAVE_LINUX_MEMPOLICY_H && HAVE_NUMAIF_H \ && HAVE_MPOL_CONSTANTS -#include <numaif.h> -#include <numa.h> -#include <sys/mman.h> -#include <stdio.h> -#include <unistd.h> -#include <stdlib.h> -#include <string.h> -#include <errno.h> - #if defined(LIBNUMA_API_VERSION) && LIBNUMA_API_VERSION == 2 - static unsigned long pagesize; static int opt_node; static char *opt_nodestr; @@ -57,7 +60,7 @@ static option_t options[] = { static void usage(void); -int main(int argc, char** argv) +int main(int argc, char **argv) { FILE *fp; void *addr, *start, *end, *lastend; @@ -159,12 +162,14 @@ void usage(void) printf(" -n Number of NUMA nodes\n"); } #else /* libnuma v1 */ -int main(void) { +int main(void) +{ tst_brkm(TCONF, NULL, "XXX: test is only supported on libnuma v2."); } #endif #else /* no NUMA */ -int main(void) { +int main(void) +{ tst_brkm(TCONF, NULL, "no NUMA development packages installed."); } #endif diff --git a/testcases/kernel/mem/vma/vma04.c b/testcases/kernel/mem/vma/vma04.c index 843e16e..cff0342 100644 --- a/testcases/kernel/mem/vma/vma04.c +++ b/testcases/kernel/mem/vma/vma04.c @@ -34,18 +34,17 @@ #include "config.h" #include <sys/types.h> #include <sys/mman.h> +#include <errno.h> #if HAVE_NUMA_H #include <numa.h> #endif #if HAVE_NUMAIF_H #include <numaif.h> #endif -#include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> - #include "test.h" #include "usctest.h" #include "safe_macros.h" diff --git a/testcases/kernel/mem/zram/zram01.c b/testcases/kernel/mem/zram/zram01.c index 560f8b8..68e32f0 100644 --- a/testcases/kernel/mem/zram/zram01.c +++ b/testcases/kernel/mem/zram/zram01.c @@ -26,22 +26,23 @@ #include <sys/types.h> #include <sys/stat.h> #include <sys/mman.h> +#include <errno.h> #include <fcntl.h> #include <stdio.h> -#include <errno.h> -#include <unistd.h> #include <string.h> +#include <unistd.h> #include "test.h" #include "usctest.h" char *TCID = "zram01"; int TST_TOTAL = 1; -int modprobe = 0; #define PATH_ZRAM "/sys/block/zram0" #define SIZE (512 * 1024 * 1024L) #define DEVICE "/dev/zram0" +static int modprobe; + static void set_disksize(void); static void write_device(void); static void verify_device(void); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fork/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/fork/1-1.c index b2a999a..f409e2d 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/fork/1-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/fork/1-1.c @@ -43,8 +43,8 @@ #include <time.h> #include <unistd.h> -#include "testfrmw.h" -#include "testfrmw.c" +#include "../testfrmw/testfrmw.h" +#include "../testfrmw/testfrmw.c" /* * This header is responsible for defining the following macros: diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fork/11-1.c b/testcases/open_posix_testsuite/conformance/interfaces/fork/11-1.c index 3e47f99..ffff125 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/fork/11-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/fork/11-1.c @@ -49,8 +49,8 @@ /********************************************************************************************/ /****************************** Test framework *****************************************/ /********************************************************************************************/ -#include "testfrmw.h" - #include "testfrmw.c" +#include "../testfrmw/testfrmw.h" + #include "../testfrmw/testfrmw.c" /* This header is responsible for defining the following macros: * UNRESOLVED(ret, descr); * where descr is a description of the error and ret is an int (error code for example) diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fork/12-1.c b/testcases/open_posix_testsuite/conformance/interfaces/fork/12-1.c index 3a71c7a..330f02e 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/fork/12-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/fork/12-1.c @@ -50,8 +50,8 @@ /********************************************************************************************/ /****************************** Test framework *****************************************/ /********************************************************************************************/ -#include "testfrmw.h" - #include "testfrmw.c" +#include "../testfrmw/testfrmw.h" + #include "../testfrmw/testfrmw.c" /* This header is responsible for defining the following macros: * UNRESOLVED(ret, descr); * where descr is a description of the error and ret is an int (error code for example) diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fork/13-1.c b/testcases/open_posix_testsuite/conformance/interfaces/fork/13-1.c index 256ee96..01df3d0 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/fork/13-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/fork/13-1.c @@ -53,8 +53,8 @@ /********************************************************************************************/ /****************************** Test framework *****************************************/ /******************************... [truncated message content] |