From: Li Wang <liwang@redhat.com>
To: Martin Doucha <mdoucha@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] hugemmap32: guarantee enough memory for gigantic hugepage
Date: Thu, 11 May 2023 20:19:51 +0800 [thread overview]
Message-ID: <CAEemH2dRVgPxw0TV40M_xgbwPezR1eehooV9ksazbATrPpBqAA@mail.gmail.com> (raw)
In-Reply-To: <cdd66dfb-b9a1-2a58-abe0-895def28d2ed@suse.cz>
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
prev parent reply other threads:[~2023-05-11 12:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAEemH2dRVgPxw0TV40M_xgbwPezR1eehooV9ksazbATrPpBqAA@mail.gmail.com \
--to=liwang@redhat.com \
--cc=ltp@lists.linux.it \
--cc=mdoucha@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).