* [LTP] [PATCH] hugemmap32: Check for hugetlbfs availability
@ 2023-05-11 11:17 Martin Doucha
2023-05-11 11:29 ` Cyril Hrubis
0 siblings, 1 reply; 2+ messages in thread
From: Martin Doucha @ 2023-05-11 11:17 UTC (permalink / raw)
To: ltp
Trying to open PATH_HUGEPAGE unconditionally will fail if hugepage
support is disabled in kernel or not provided by hardware.
Signed-off-by: Martin Doucha <mdoucha@suse.cz>
---
testcases/kernel/mem/hugetlb/hugemmap/hugemmap32.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap32.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap32.c
index 85d57319f..36a426a09 100644
--- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap32.c
+++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap32.c
@@ -47,6 +47,9 @@ static void setup(void)
struct dirent *ent;
unsigned long hpage_size;
+ if (access(PATH_HUGEPAGE, F_OK))
+ tst_brk(TCONF, "hugetlbfs is not supported");
+
dir = SAFE_OPENDIR(PATH_HUGEPAGE);
while ((ent = SAFE_READDIR(dir))) {
if ((sscanf(ent->d_name, "hugepages-%lukB", &hpage_size) == 1) &&
--
2.40.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [LTP] [PATCH] hugemmap32: Check for hugetlbfs availability
2023-05-11 11:17 [LTP] [PATCH] hugemmap32: Check for hugetlbfs availability Martin Doucha
@ 2023-05-11 11:29 ` Cyril Hrubis
0 siblings, 0 replies; 2+ messages in thread
From: Cyril Hrubis @ 2023-05-11 11:29 UTC (permalink / raw)
To: Martin Doucha; +Cc: ltp
Hi!
Pushed, thanks.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-05-11 11:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-11 11:17 [LTP] [PATCH] hugemmap32: Check for hugetlbfs availability Martin Doucha
2023-05-11 11:29 ` Cyril Hrubis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).