tst_sys_conf.c: Report TCONF if read path trigger error such as EOPNOTSUPP
PATCH 1/1 tst_sys_conf.c: Report TCONF if read path trigger error such as EOPNOTSUPP
We encounter EOPNOTSUPP error when read path in old sle power test env, the reason is hugepages are disabled. Detail error information such as:
TEST cpuset02:
tst_sys_conf.c:103: TBROK: Failed to read anything from '/proc/sys/vm/nr_hugepages': EOPNOTSUPP (95)
--- lib/tst_sys_conf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
lib/tst_sys_conf.c +2 -1
@@ -99,7 +99,8 @@ int tst_sys_conf_save(const struct tst_path_val *conf)if (conf->flags &TST_SR_IGNORE_ERR )return 1 ; -tst_brk (TBROK |TERRNO ,"Failed to read anything from '%s'" , + ttype = conf->flags ?TBROK :TCONF ; +tst_brk (ttype |TERRNO ,"Failed to read anything from '%s'" , conf->path); }
Signature · 5 lines
2.51.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi!
Quoted 15 lines
We encounter EOPNOTSUPP error when read path in old sle power test env, the reason is hugepages are disabled. Detail error information such as:
TEST cpuset02:
tst_sys_conf.c:103: TBROK: Failed to read anything from '/proc/sys/vm/nr_hugepages': EOPNOTSUPP (95)Signed-off-by Wei Gao <[email protected]>--- lib/tst_sys_conf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)lib/tst_sys_conf.c +0
-0
lib/tst_sys_conf.c int tst_sys_conf_save(const struct tst_path_val *conf) · line 102
Quoted 5 lines
lib/tst_sys_conf.c +1
-1@@ -99,7 +99,8 @@ int tst_sys_conf_save(const struct tst_path_val *conf)if (conf->flags &TST_SR_IGNORE_ERR )return 1 ; - tst_brk(TBROK | TERRNO, "Failed to read anything from '%s'", + ttype = conf->flags ?TBROK :TCONF ;
This is wrong for two reasons:
We have to make sure to use the correct flag here. I suppose that we can treat the EOPNOTSUPP the same as the file to be missing. So we would change the outcome based on the TST_SR_*_MISSING flags.
All errnos but EOPNOTSUPP should be treated as a TBROK as they were before.
Quoted 10 lines
lib/tst_sys_conf.c +1
-0+tst_brk (ttype |TERRNO ,"Failed to read anything from '%s'" , conf->path); }Signature · 5 lines
2.51.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Signature · 5 lines
Cyril Hrubis [email protected] -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi,
I don't see any reason to make this change. You should remove the .save_restore in cpuset02 instead because it's pointless. You don't change the value in /proc/sys/vm/nr_hugepages as far as I can tell and the file doesn't need to be restored even if you did.
Quoted 24 lines · Wei Gao via ltp
We encounter EOPNOTSUPP error when read path in old sle power test env, the reason is hugepages are disabled. Detail error information such as:
TEST cpuset02:
tst_sys_conf.c:103: TBROK: Failed to read anything from '/proc/sys/vm/nr_hugepages': EOPNOTSUPP (95)Signed-off-by Wei Gao <[email protected]>--- lib/tst_sys_conf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)lib/tst_sys_conf.c +2
-1@@ -99,7 +99,8 @@ int tst_sys_conf_save(const struct tst_path_val *conf)if (conf->flags &TST_SR_IGNORE_ERR )return 1 ; -tst_brk (TBROK |TERRNO ,"Failed to read anything from '%s'" , + ttype = conf->flags ?TBROK :TCONF ; +tst_brk (ttype |TERRNO ,"Failed to read anything from '%s'" , conf->path); }
Signature · 10 lines
Martin Doucha [email protected] SW Quality Engineer SUSE LINUX, s.r.o. CORSO IIa Krizikova 148/34 186 00 Prague 8 Czech Republic -- Mailing list info: https://lists.linux.it/listinfo/ltp
v2 cover tst_test.c: Add hugepage check in prepare_and_mount_hugetlb_fs
In reply to Wei Gao via ltpWei Gao (2):
tst_test.c: Add hugepage check in prepare_and_mount_hugetlb_fs cpuset02.c: Remove unnecessary .save_restore setting
lib/tst_test.c | 4 ++++ testcases/kernel/mem/cpuset/cpuset02.c | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-)
Signature · 5 lines
2.51.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH v2 1/2 tst_test.c: Add hugepage check in prepare_and_mount_hugetlb_fs
If test case only enable .needs_hugetlbfs without .hugepages then will trigger mount error in prepare_and_mount_hugetlb_fs. So Add hugepage check within prepare_and_mount_hugetlb_fs.
--- lib/tst_test.c | 4 ++++ 1 file changed, 4 insertions(+)
lib/tst_test.c +4 -0
@@ -38,6 +38,7 @@#include "old_device.h" #include "old_tmpdir.h" #include "ltp-version.h" +#include "tst_hugepage.h" /* * Hack to get TCID defined in newlib tests
@@ -1192,6 +1193,9 @@ static void prepare_and_mount_dev_fs(const char *mntpoint)static void prepare_and_mount_hugetlb_fs (void ) { +if (access (PATH_HUGEPAGES ,F_OK )) +tst_brk (TCONF ,"hugetlbfs is not supported" ); +SAFE_MOUNT ("none" , tst_test->mntpoint,"hugetlbfs" ,0 ,NULL ); context->mntpoint_mounted =1 ; }
Signature · 5 lines
2.51.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH v2 2/2 cpuset02.c: Remove unnecessary .save_restore setting
In reply to Wei Gao via ltp--- testcases/kernel/mem/cpuset/cpuset02.c | 4 ---- 1 file changed, 4 deletions(-)
testcases/kernel/mem/cpuset/cpuset02.c +0 -4
@@ -121,10 +121,6 @@ static struct tst_test test = { .forks_child = 1, .test_all = run_test, .needs_cgroup_ctrls = (const char *const []){ "cpuset", NULL }, - .save_restore = (const struct tst_path_val []) { - {"/proc/sys/vm/nr_hugepages" ,NULL ,TST_SR_TCONF }, - {} - }, };#else
Signature · 5 lines
2.51.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [PATCH v2 0/2] tst_test.c: Add hugepage check in prepare_and_mount_hugetlb_fs
In reply to Wei Gao via ltpHi!
Patchset applied, thanks.
Signature · 5 lines
Cyril Hrubis [email protected] -- Mailing list info: https://lists.linux.it/listinfo/ltp