* [LTP] [PATCH v1] tst_sys_conf.c: Report TCONF if read path trigger error such as EOPNOTSUPP
@ 2025-09-02 13:51 Wei Gao via ltp
2025-09-03 8:43 ` Cyril Hrubis
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Wei Gao via ltp @ 2025-09-02 13:51 UTC (permalink / raw)
To: 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 <wegao@suse.com>
---
lib/tst_sys_conf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/tst_sys_conf.c b/lib/tst_sys_conf.c
index 80cd83569..30b0b67a8 100644
--- a/lib/tst_sys_conf.c
+++ b/lib/tst_sys_conf.c
@@ -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);
}
--
2.51.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [LTP] [PATCH v1] tst_sys_conf.c: Report TCONF if read path trigger error such as EOPNOTSUPP
2025-09-02 13:51 [LTP] [PATCH v1] tst_sys_conf.c: Report TCONF if read path trigger error such as EOPNOTSUPP Wei Gao via ltp
@ 2025-09-03 8:43 ` Cyril Hrubis
2025-09-03 10:01 ` Martin Doucha
2025-09-04 1:58 ` [LTP] [PATCH v2 0/2] tst_test.c: Add hugepage check in prepare_and_mount_hugetlb_fs Wei Gao via ltp
2 siblings, 0 replies; 7+ messages in thread
From: Cyril Hrubis @ 2025-09-03 8:43 UTC (permalink / raw)
To: Wei Gao; +Cc: ltp
Hi!
> 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 <wegao@suse.com>
> ---
> lib/tst_sys_conf.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lib/tst_sys_conf.c b/lib/tst_sys_conf.c
> index 80cd83569..30b0b67a8 100644
> --- a/lib/tst_sys_conf.c
> +++ b/lib/tst_sys_conf.c
> @@ -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.
> + tst_brk(ttype | TERRNO, "Failed to read anything from '%s'",
> conf->path);
> }
>
> --
> 2.51.0
>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [LTP] [PATCH v1] tst_sys_conf.c: Report TCONF if read path trigger error such as EOPNOTSUPP
2025-09-02 13:51 [LTP] [PATCH v1] tst_sys_conf.c: Report TCONF if read path trigger error such as EOPNOTSUPP Wei Gao via ltp
2025-09-03 8:43 ` Cyril Hrubis
@ 2025-09-03 10:01 ` Martin Doucha
2025-09-04 1:58 ` [LTP] [PATCH v2 0/2] tst_test.c: Add hugepage check in prepare_and_mount_hugetlb_fs Wei Gao via ltp
2 siblings, 0 replies; 7+ messages in thread
From: Martin Doucha @ 2025-09-03 10:01 UTC (permalink / raw)
To: Wei Gao, 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.
On 02. 09. 25 15:51, Wei Gao via ltp wrote:
> 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 <wegao@suse.com>
> ---
> lib/tst_sys_conf.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lib/tst_sys_conf.c b/lib/tst_sys_conf.c
> index 80cd83569..30b0b67a8 100644
> --- a/lib/tst_sys_conf.c
> +++ b/lib/tst_sys_conf.c
> @@ -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);
> }
>
--
Martin Doucha mdoucha@suse.cz
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* [LTP] [PATCH v2 0/2] tst_test.c: Add hugepage check in prepare_and_mount_hugetlb_fs
2025-09-02 13:51 [LTP] [PATCH v1] tst_sys_conf.c: Report TCONF if read path trigger error such as EOPNOTSUPP Wei Gao via ltp
2025-09-03 8:43 ` Cyril Hrubis
2025-09-03 10:01 ` Martin Doucha
@ 2025-09-04 1:58 ` Wei Gao via ltp
2025-09-04 1:58 ` [LTP] [PATCH v2 1/2] " Wei Gao via ltp
` (2 more replies)
2 siblings, 3 replies; 7+ messages in thread
From: Wei Gao via ltp @ 2025-09-04 1:58 UTC (permalink / raw)
To: ltp; +Cc: Martin Doucha
Wei 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(-)
--
2.51.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 7+ messages in thread* [LTP] [PATCH v2 1/2] tst_test.c: Add hugepage check in prepare_and_mount_hugetlb_fs
2025-09-04 1:58 ` [LTP] [PATCH v2 0/2] tst_test.c: Add hugepage check in prepare_and_mount_hugetlb_fs Wei Gao via ltp
@ 2025-09-04 1:58 ` Wei Gao via ltp
2025-09-04 1:58 ` [LTP] [PATCH v2 2/2] cpuset02.c: Remove unnecessary .save_restore setting Wei Gao via ltp
2025-09-10 11:15 ` [LTP] [PATCH v2 0/2] tst_test.c: Add hugepage check in prepare_and_mount_hugetlb_fs Cyril Hrubis
2 siblings, 0 replies; 7+ messages in thread
From: Wei Gao via ltp @ 2025-09-04 1:58 UTC (permalink / raw)
To: ltp; +Cc: Martin Doucha
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.
Signed-off-by: Wei Gao <wegao@suse.com>
---
lib/tst_test.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/tst_test.c b/lib/tst_test.c
index b8894f782..2217595e6 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -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;
}
--
2.51.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 7+ messages in thread* [LTP] [PATCH v2 2/2] cpuset02.c: Remove unnecessary .save_restore setting
2025-09-04 1:58 ` [LTP] [PATCH v2 0/2] tst_test.c: Add hugepage check in prepare_and_mount_hugetlb_fs Wei Gao via ltp
2025-09-04 1:58 ` [LTP] [PATCH v2 1/2] " Wei Gao via ltp
@ 2025-09-04 1:58 ` Wei Gao via ltp
2025-09-10 11:15 ` [LTP] [PATCH v2 0/2] tst_test.c: Add hugepage check in prepare_and_mount_hugetlb_fs Cyril Hrubis
2 siblings, 0 replies; 7+ messages in thread
From: Wei Gao via ltp @ 2025-09-04 1:58 UTC (permalink / raw)
To: ltp; +Cc: Martin Doucha
Signed-off-by: Wei Gao <wegao@suse.com>
---
testcases/kernel/mem/cpuset/cpuset02.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/testcases/kernel/mem/cpuset/cpuset02.c b/testcases/kernel/mem/cpuset/cpuset02.c
index 25f778806..ccfddd6a2 100644
--- a/testcases/kernel/mem/cpuset/cpuset02.c
+++ b/testcases/kernel/mem/cpuset/cpuset02.c
@@ -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
--
2.51.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [LTP] [PATCH v2 0/2] tst_test.c: Add hugepage check in prepare_and_mount_hugetlb_fs
2025-09-04 1:58 ` [LTP] [PATCH v2 0/2] tst_test.c: Add hugepage check in prepare_and_mount_hugetlb_fs Wei Gao via ltp
2025-09-04 1:58 ` [LTP] [PATCH v2 1/2] " Wei Gao via ltp
2025-09-04 1:58 ` [LTP] [PATCH v2 2/2] cpuset02.c: Remove unnecessary .save_restore setting Wei Gao via ltp
@ 2025-09-10 11:15 ` Cyril Hrubis
2 siblings, 0 replies; 7+ messages in thread
From: Cyril Hrubis @ 2025-09-10 11:15 UTC (permalink / raw)
To: Wei Gao; +Cc: Martin Doucha, ltp
Hi!
Patchset applied, thanks.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-09-10 11:14 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-02 13:51 [LTP] [PATCH v1] tst_sys_conf.c: Report TCONF if read path trigger error such as EOPNOTSUPP Wei Gao via ltp
2025-09-03 8:43 ` Cyril Hrubis
2025-09-03 10:01 ` Martin Doucha
2025-09-04 1:58 ` [LTP] [PATCH v2 0/2] tst_test.c: Add hugepage check in prepare_and_mount_hugetlb_fs Wei Gao via ltp
2025-09-04 1:58 ` [LTP] [PATCH v2 1/2] " Wei Gao via ltp
2025-09-04 1:58 ` [LTP] [PATCH v2 2/2] cpuset02.c: Remove unnecessary .save_restore setting Wei Gao via ltp
2025-09-10 11:15 ` [LTP] [PATCH v2 0/2] tst_test.c: Add hugepage check in prepare_and_mount_hugetlb_fs Cyril Hrubis
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.