* [LTP] [PATCH] hugemmap32: guarantee enough memory for gigantic hugepage
@ 2023-05-08 13:49 Li Wang
2023-05-10 13:18 ` Cyril Hrubis
2023-05-11 11:04 ` Martin Doucha
0 siblings, 2 replies; 4+ messages in thread
From: Li Wang @ 2023-05-08 13:49 UTC (permalink / raw)
To: ltp
To get rid of warning on ppc64le:
hugemmap32.c:34: TWARN: Failed to close FILE
'/sys/kernel/mm/hugepages/hugepages-16777216kB/nr_hugepages'
hugemmap32.c:35: TCONF: Can't update the gigantic hugepages.
hugemmap32.c:69: TWARN: Failed to close FILE
'/sys/kernel/mm/hugepages/hugepages-16777216kB/nr_hugepages': EINVAL (22)
# ll /sys/kernel/mm/hugepages/
total 0
drwxr-xr-x. 2 root root 0 May 4 02:02 hugepages-16384kB
drwxr-xr-x. 2 root root 0 May 4 02:02 hugepages-16777216kB
# cat /proc/meminfo | grep -i Hugepagesize
Hugepagesize: 16384 kB
# free -h
total used free shared buff/cache available
Mem: 7.4Gi 1.1Gi 992Mi 13Mi 5.9Gi 6.3Gi
Swap: 4.0Gi 0B 4.0Gi
Signed-off-by: Li Wang <liwang@redhat.com>
---
testcases/kernel/mem/hugetlb/hugemmap/hugemmap32.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap32.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap32.c
index 34b322bfa..7ff23b236 100644
--- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap32.c
+++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap32.c
@@ -60,6 +60,12 @@ static void setup(void)
tst_brk(TCONF, "Gigantic hugepages not supported");
SAFE_CLOSEDIR(dir);
+
+ if (tst_available_mem() < (long long)hpage_size) {
+ g_hpage_path[0] = '\0';
+ tst_brk(TCONF, "No enough memory for gigantic hugepage reserving");
+ }
+
SAFE_FILE_LINES_SCANF(g_hpage_path, "%d", &org_g_hpages);
}
--
2.40.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH] hugemmap32: guarantee enough memory for gigantic hugepage
2023-05-08 13:49 [LTP] [PATCH] hugemmap32: guarantee enough memory for gigantic hugepage Li Wang
@ 2023-05-10 13:18 ` Cyril Hrubis
2023-05-11 11:04 ` Martin Doucha
1 sibling, 0 replies; 4+ messages in thread
From: Cyril Hrubis @ 2023-05-10 13:18 UTC (permalink / raw)
To: Li Wang; +Cc: ltp
Hi!
> diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap32.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap32.c
> index 34b322bfa..7ff23b236 100644
> --- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap32.c
> +++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap32.c
> @@ -60,6 +60,12 @@ static void setup(void)
> tst_brk(TCONF, "Gigantic hugepages not supported");
>
> SAFE_CLOSEDIR(dir);
> +
> + if (tst_available_mem() < (long long)hpage_size) {
> + g_hpage_path[0] = '\0';
> + tst_brk(TCONF, "No enough memory for gigantic hugepage reserving");
^
reservation
> + }
> +
> SAFE_FILE_LINES_SCANF(g_hpage_path, "%d", &org_g_hpages);
> }
Otherwise it looks good:
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH] hugemmap32: guarantee enough memory for gigantic hugepage
2023-05-08 13:49 [LTP] [PATCH] hugemmap32: guarantee enough memory for gigantic hugepage Li Wang
2023-05-10 13:18 ` Cyril Hrubis
@ 2023-05-11 11:04 ` Martin Doucha
2023-05-11 12:19 ` Li Wang
1 sibling, 1 reply; 4+ messages in thread
From: Martin Doucha @ 2023-05-11 11:04 UTC (permalink / raw)
To: Li Wang, ltp
Hi,
On 08. 05. 23 15:49, Li Wang wrote:
> To get rid of warning on ppc64le:
>
> hugemmap32.c:34: TWARN: Failed to close FILE
> '/sys/kernel/mm/hugepages/hugepages-16777216kB/nr_hugepages'
> hugemmap32.c:35: TCONF: Can't update the gigantic hugepages.
> hugemmap32.c:69: TWARN: Failed to close FILE
> '/sys/kernel/mm/hugepages/hugepages-16777216kB/nr_hugepages': EINVAL (22)
>
> # ll /sys/kernel/mm/hugepages/
> total 0
> drwxr-xr-x. 2 root root 0 May 4 02:02 hugepages-16384kB
> drwxr-xr-x. 2 root root 0 May 4 02:02 hugepages-16777216kB
>
> # cat /proc/meminfo | grep -i Hugepagesize
> Hugepagesize: 16384 kB
>
> # free -h
> total used free shared buff/cache available
> Mem: 7.4Gi 1.1Gi 992Mi 13Mi 5.9Gi 6.3Gi
> Swap: 4.0Gi 0B 4.0Gi
>
> Signed-off-by: Li Wang <liwang@redhat.com>
> ---
> testcases/kernel/mem/hugetlb/hugemmap/hugemmap32.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap32.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap32.c
> index 34b322bfa..7ff23b236 100644
> --- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap32.c
> +++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap32.c
> @@ -60,6 +60,12 @@ static void setup(void)
> tst_brk(TCONF, "Gigantic hugepages not supported");
>
> SAFE_CLOSEDIR(dir);
> +
> + if (tst_available_mem() < (long long)hpage_size) {
> + g_hpage_path[0] = '\0';
> + tst_brk(TCONF, "No enough memory for gigantic hugepage reserving");
> + }
> +
> SAFE_FILE_LINES_SCANF(g_hpage_path, "%d", &org_g_hpages);
> }
I also recommend calling
SAFE_FILE_PRINTF("/proc/sys/vm/drop_caches", "3");
It doesn't whether you do it before or after tst_available_mem() since
caches count as available.
--
Martin Doucha mdoucha@suse.cz
QA Engineer for Software Maintenance
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] 4+ messages in thread
* Re: [LTP] [PATCH] hugemmap32: guarantee enough memory for gigantic hugepage
2023-05-11 11:04 ` Martin Doucha
@ 2023-05-11 12:19 ` Li Wang
0 siblings, 0 replies; 4+ messages in thread
From: Li Wang @ 2023-05-11 12:19 UTC (permalink / raw)
To: Martin Doucha; +Cc: ltp
On Thu, May 11, 2023 at 7:10 PM Martin Doucha <mdoucha@suse.cz> wrote:
> Hi,
>
> On 08. 05. 23 15:49, Li Wang wrote:
> > To get rid of warning on ppc64le:
> >
> > hugemmap32.c:34: TWARN: Failed to close FILE
> > '/sys/kernel/mm/hugepages/hugepages-16777216kB/nr_hugepages'
> > hugemmap32.c:35: TCONF: Can't update the gigantic hugepages.
> > hugemmap32.c:69: TWARN: Failed to close FILE
> > '/sys/kernel/mm/hugepages/hugepages-16777216kB/nr_hugepages':
> EINVAL (22)
> >
> > # ll /sys/kernel/mm/hugepages/
> > total 0
> > drwxr-xr-x. 2 root root 0 May 4 02:02 hugepages-16384kB
> > drwxr-xr-x. 2 root root 0 May 4 02:02 hugepages-16777216kB
> >
> > # cat /proc/meminfo | grep -i Hugepagesize
> > Hugepagesize: 16384 kB
> >
> > # free -h
> > total used free shared buff/cache
> available
> > Mem: 7.4Gi 1.1Gi 992Mi 13Mi 5.9Gi
> 6.3Gi
> > Swap: 4.0Gi 0B 4.0Gi
> >
> > Signed-off-by: Li Wang <liwang@redhat.com>
> > ---
> > testcases/kernel/mem/hugetlb/hugemmap/hugemmap32.c | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap32.c
> b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap32.c
> > index 34b322bfa..7ff23b236 100644
> > --- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap32.c
> > +++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap32.c
> > @@ -60,6 +60,12 @@ static void setup(void)
> > tst_brk(TCONF, "Gigantic hugepages not supported");
> >
> > SAFE_CLOSEDIR(dir);
> > +
> > + if (tst_available_mem() < (long long)hpage_size) {
> > + g_hpage_path[0] = '\0';
> > + tst_brk(TCONF, "No enough memory for gigantic hugepage
> reserving");
> > + }
> > +
> > SAFE_FILE_LINES_SCANF(g_hpage_path, "%d", &org_g_hpages);
> > }
>
> I also recommend calling
> SAFE_FILE_PRINTF("/proc/sys/vm/drop_caches", "3");
>
> It doesn't whether you do it before or after tst_available_mem() since
> caches count as available.
>
Good point, could you send a patch or delay this work after release as well?
>
> --
> Martin Doucha mdoucha@suse.cz
> QA Engineer for Software Maintenance
> SUSE LINUX, s.r.o.
> CORSO IIa
> Krizikova 148/34
> 186 00 Prague 8
> Czech Republic
>
>
--
Regards,
Li Wang
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-05-11 12:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-08 13:49 [LTP] [PATCH] hugemmap32: guarantee enough memory for gigantic hugepage Li Wang
2023-05-10 13:18 ` Cyril Hrubis
2023-05-11 11:04 ` Martin Doucha
2023-05-11 12:19 ` Li Wang
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).