* [LTP] [PATCH] kernel/hugemmap05.c: Skip test when default Hugepagesize 1G
@ 2022-04-22 3:35 Wang Kunfeng via ltp
2022-04-25 11:53 ` Cyril Hrubis
0 siblings, 1 reply; 2+ messages in thread
From: Wang Kunfeng via ltp @ 2022-04-22 3:35 UTC (permalink / raw)
To: ltp
The kernel is not allow to change the file that
/proc/sys/vm/nr_overcommit_hugepages,
when default Hugepagesize 1G,so the testcase
will be fail when close it.
Signen-off-by: Wang Kunfeng <threefifteen.wangkunfeng@huawei.com>
---
testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c
index 40d3bd8da..5c78d0635 100644
--- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c
+++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c
@@ -61,6 +61,7 @@ static int key = -1, shmid = -1, fd = -1;
static int mounted, restore_shmmax, restore_overcomm_hgpgs;
static long hugepagesize, nr_overcommit_hugepages;
static long size = NR_HPAGES, length = (NR_HPAGES + NR_HPAGES/2) * 2;
+static long default_hugepagesize = 1048576;
char *opt_sysfs;
char *opt_alloc;
@@ -188,6 +189,10 @@ static void setup(void)
if (tst_hugepages != NR_HPAGES)
tst_brk(TCONF, "Not enough hugepages for testing!");
+ hugepagesize = SAFE_READ_MEMINFO("Hugepagesize:");
+ if (hugepagesize == default_hugepagesize)
+ tst_brk(TCONF, "system hugepagesize default 1G,the testcase not support!");
+
hugepagesize = SAFE_READ_MEMINFO("Hugepagesize:") * 1024;
init_sys_sz_paths();
2.17.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [LTP] [PATCH] kernel/hugemmap05.c: Skip test when default Hugepagesize 1G
2022-04-22 3:35 [LTP] [PATCH] kernel/hugemmap05.c: Skip test when default Hugepagesize 1G Wang Kunfeng via ltp
@ 2022-04-25 11:53 ` Cyril Hrubis
0 siblings, 0 replies; 2+ messages in thread
From: Cyril Hrubis @ 2022-04-25 11:53 UTC (permalink / raw)
To: Wang Kunfeng; +Cc: ltp
Hi!
> The kernel is not allow to change the file that
> /proc/sys/vm/nr_overcommit_hugepages,
> when default Hugepagesize 1G,so the testcase
> will be fail when close it.
I'm not sure what the exact problem is, but I guess that there is not
enough (continuous) memory to enable the overcommit, right?
In that case disabling the test on 1GB hugepages is certainly wrong.
What errno do we get if we attempt to close the file?
--
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:[~2022-04-25 11:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-22 3:35 [LTP] [PATCH] kernel/hugemmap05.c: Skip test when default Hugepagesize 1G Wang Kunfeng via ltp
2022-04-25 11:53 ` 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.