madvise11: Allow test to skip if MADV_SOFT_OFFLINE is not supported
PATCH 1/1 madvise11: Allow test to skip if MADV_SOFT_OFFLINE is not supported
madvise11 will exit with TFAIL if CONFIG_MEMORY_FAILURE is not configured. Skip the TFAIL if EINVAL is returned by madvise.
--- testcases/kernel/syscalls/madvise/madvise11.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
testcases/kernel/syscalls/madvise/madvise11.c +4 -3
@@ -162,7 +162,7 @@ static void *alloc_mem(void *threadnum) err =allocate_offline (tnum);tst_res (TINFO ,"Thread [%d] returned %d, %s." , tnum, err, (err ?"failed" :"succeeded" )); -return (void *)(uintptr_t ) (err ?-1 :0 ); +return (void *)(uintptr_t ) err; }static void stress_alloc_offl (void )
@@ -188,8 +188,9 @@ static void stress_alloc_offl(void)SAFE_PTHREAD_JOIN (thread_ids[thread_index], &status);if ((intptr_t )status !=0 ) { -tst_res (TFAIL ,"thread [%d] - exited with errors" , - thread_index); +if ((intptr_t )status !=EINVAL ) +tst_res (TFAIL ,"thread [%d] - exited with errors" , + thread_index); thread_failure++; } }
Signature · 5 lines
2.42.0.869.gea05f2083d-goog -- Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH 1/1 madvise11: Replace /etc/mtab with /proc/mounts
Android does not have the /etc/mtab symlink, so trying to open it fails with TBROK. Replace it with /proc/mounts.
--- testcases/kernel/syscalls/madvise/madvise11.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
testcases/kernel/syscalls/madvise/madvise11.c +2 -2
@@ -308,9 +308,9 @@ static int open_unpoison_pfn(void)SAFE_CMD (cmd_modprobe,NULL ,NULL );/* debugfs mount point */ - mntf =setmntent ("/etc/mtab" ,"r" ); + mntf =setmntent ("/proc/mounts" ,"r" );if (!mntf) { -tst_brk (TBROK |TERRNO ,"Can't open /etc/mtab" ); +tst_brk (TBROK |TERRNO ,"Can't open /proc/mounts" );return -1 ; }while ((mnt =getmntent (mntf)) !=NULL ) {
Signature · 5 lines
2.42.0.869.gea05f2083d-goog -- Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [PATCH] madvise11: Replace /etc/mtab with /proc/mounts
Hi Edward,
Quoted 2 lines
Android does not have the
/etc/mtabsymlink, so trying to open it fails with TBROK. Replace it with/proc/mounts.
Thanks!
BTW there are other tests which mention /etc/mtab, but only as tst_resm(TINFO, ) message.
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Petr Vorel
AppliedRe: [LTP] [PATCH] madvise11: Replace /etc/mtab with /proc/mounts
Hi Edward,
merged, thanks!
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Hi!
Quoted 2 lines
madvise11 will exit with TFAIL if
CONFIG_MEMORY_FAILUREis not configured. Skip the TFAIL if EINVAL is returned by madvise.
Does it make sense to keep the test running if the config option is not present? As far as I can tell we are trying to reproduce a race there that depends on the madvise being able to soft offline the pages.
What about this then?
testcases/kernel/syscalls/madvise/madvise11.c +4 -0
@@ -426,6 +426,10 @@ static struct tst_test test = {"rmmod" ,NULL }, + .needs_kconfigs = (const char *[]) { +"CONFIG_MEMORY_FAILURE=y" , +NULL + }, .max_runtime = 30, .needs_checkpoints = 1, .setup = setup,
Signature · 5 lines
Cyril Hrubis [email protected] -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Cyril,
Quoted 19 lines · Cyril Hrubis
Hi!
Quoted 2 lines
madvise11 will exit with TFAIL if
CONFIG_MEMORY_FAILUREis not configured. Skip the TFAIL if EINVAL is returned by madvise.Does it make sense to keep the test running if the config option is not present? As far as I can tell we are trying to reproduce a race there that depends on the madvise being able to soft offline the pages.
What about this then?
testcases/kernel/syscalls/madvise/madvise11.c +0
-0@@ -426,6 +426,10 @@ static struct tst_test test = {"rmmod" ,NULL },
testcases/kernel/syscalls/madvise/madvise11.c static struct tst_test test = {
Quoted 10 lines
testcases/kernel/syscalls/madvise/madvise11.c +4
-1+ .needs_kconfigs = (const char *[]) { +"CONFIG_MEMORY_FAILURE=y" , +NULL + }, .max_runtime = 30, .needs_checkpoints = 1, .setup = setup, --
Yeah, that makes more sense to me.
Quoted 2 lines
Cyril Hrubis
[email protected]
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp