From: Caspar Z. <su...@li...> - 2012-07-02 08:33:57
|
The branch, master, has been updated via 586992b33b0e0df9a4c7b27dcb165f774bd008f3 (commit) via 3d8e9490dfb5369dc9df8b2846912df71451c5e1 (commit) via 1f43a50165ffa0cf87831da95ccf6b5d3c11ba5c (commit) from d9235f8c72be368b811d6918a7ec90b030bab9b7 (commit) - Log ----------------------------------------------------------------- commit 586992b33b0e0df9a4c7b27dcb165f774bd008f3 Author: Caspar Zhang <ca...@ca...> Date: Mon May 14 12:22:30 2012 +0800 hugetlb: shmmax could be ULONG_MAX - 1 on some systems, shmmax could be ULONG_MAX - 1 by default, but SAFE_STRTOL() upper bound is LONG_MAX, which causes hugeshm* tests fail to parse shmmax value in SAFE_STRTOL() function. This patch increases the upper bound of SAFE_STRTOL() parameter to ULONG_MAX. Signed-off-by: Caspar Zhang <ca...@ca...> commit 3d8e9490dfb5369dc9df8b2846912df71451c5e1 Author: Caspar Zhang <ca...@ca...> Date: Tue Mar 13 15:49:40 2012 +0800 hugetlb/hugeshmat01: don't use hard-coded unaligned addr An usable unaligned addr various on different platforms, it's better to generate the addr dynamically instead of using a hard-coded one. This patch generate this unaligned addr based on first run. Signed-off-by: Caspar Zhang <ca...@ca...> commit 1f43a50165ffa0cf87831da95ccf6b5d3c11ba5c Author: Caspar Zhang <ca...@ca...> Date: Tue Mar 20 13:17:20 2012 +0800 mm/swapping01: increase swapping threshold Increasing swapping threshold on s390x to avoid accidental FAIL. Set it the same size as current free memory would be an acceptable option. Signed-off-by: Caspar Zhang <ca...@ca...> ----------------------------------------------------------------------- Summary of changes: .../kernel/mem/hugetlb/hugeshmat/hugeshmat01.c | 28 ++++++++++---------- testcases/kernel/mem/lib/mem.c | 2 +- testcases/kernel/mem/swapping/swapping01.c | 4 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat01.c b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat01.c index 3775545..2f8db05 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat01.c +++ b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat01.c @@ -66,16 +66,6 @@ int TST_TOTAL = 3; #define CASE0 10 /* values to write into the shared */ #define CASE1 20 /* memory location. */ -#if __WORDSIZE == 64 -#if defined(__mips__) -#define UNALIGNED 0x1000000eee -#else -#define UNALIGNED 0x10000000eee -#endif -#else -#define UNALIGNED 0x60000eee -#endif - static size_t shm_size; static int shm_id_1 = -1; static void *addr; @@ -92,13 +82,16 @@ struct test_case_t { int flags; } TC[] = { /* a straight forward read/write attach */ - { &shm_id_1, 0, 0 }, + { &shm_id_1, 0, 0 }, - /* an attach using non aligned memory */ - { &shm_id_1, (void *)UNALIGNED, SHM_RND }, + /* + * an attach using non aligned memory + * -1 will be replaced with an unaligned addr + */ + { &shm_id_1, (void *)-1, SHM_RND }, /* a read only attach */ - { &shm_id_1, 0, SHM_RDONLY } + { &shm_id_1, 0, SHM_RDONLY } }; static void check_functionality(int i); @@ -130,6 +123,13 @@ int main(int ac, char **av) tst_resm(TPASS, "shmat call succeeded"); } + /* + * addr in TC[0] will be used to generate an unaligned + * address for TC[1] + */ + if (i == 0 && addr != (void *)-1) + TC[1].addr = (void *)((unsigned long)addr & + ~(SHMLBA-1) + SHMLBA - 1); if (shmdt(addr) == -1) tst_brkm(TBROK|TERRNO, cleanup, "shmdt"); } diff --git a/testcases/kernel/mem/lib/mem.c b/testcases/kernel/mem/lib/mem.c index aa3f215..ae0adb4 100644 --- a/testcases/kernel/mem/lib/mem.c +++ b/testcases/kernel/mem/lib/mem.c @@ -836,7 +836,7 @@ void update_shm_size(size_t *shm_size) size_t shmmax; read_file(PATH_SHMMAX, buf); - shmmax = SAFE_STRTOL(cleanup, buf, 0, LONG_MAX); + shmmax = SAFE_STRTOL(cleanup, buf, 0, ULONG_MAX); if (*shm_size > shmmax) { tst_resm(TINFO, "Set shm_size to shmmax: %ld", shmmax); *shm_size = shmmax; diff --git a/testcases/kernel/mem/swapping/swapping01.c b/testcases/kernel/mem/swapping/swapping01.c index 24f031e..605ede4 100644 --- a/testcases/kernel/mem/swapping/swapping01.c +++ b/testcases/kernel/mem/swapping/swapping01.c @@ -60,8 +60,8 @@ char *TCID = "swapping01"; int TST_TOTAL = 1; -/* allow swapping 0.5 * phy_mem in maximum */ -#define COE_DELTA 0.5 +/* allow swapping 1 * phy_mem in maximum */ +#define COE_DELTA 1 /* will try to alloc 1.3 * phy_mem */ #define COE_SLIGHT_OVER 0.3 hooks/post-receive -- ltp |