From: Eric B Munson <emunson@mgebm.net>
To: CAI Qian <caiqian@redhat.com>
Cc: linux-mm <linux-mm@kvack.org>, mel@csn.ul.ie
Subject: Re: [PATCH] hugetlb: remove overcommit sysfs for 1GB pages
Date: Wed, 5 Jan 2011 09:44:34 -0700 [thread overview]
Message-ID: <20110105164434.GA3527@mgebm.net> (raw)
In-Reply-To: <1047497160.139161.1294239721941.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com>
[-- Attachment #1: Type: text/plain, Size: 3025 bytes --]
On Wed, 05 Jan 2011, CAI Qian wrote:
>
> ----- Original Message -----
> > On Tue, 04 Jan 2011, CAI Qian wrote:
> >
> > > 1GB pages cannot be over-commited, attempting to do so results in
> > > corruption,
> > > so remove those files for simplicity.
> > >
> > > Symptoms:
> > > 1) setup 1gb hugepages.
> > >
> > > cat /proc/cmdline
> > > ...default_hugepagesz=1g hugepagesz=1g hugepages=1...
> > >
> > > cat /proc/meminfo
> > > ...
> > > HugePages_Total: 1
> > > HugePages_Free: 1
> > > HugePages_Rsvd: 0
> > > HugePages_Surp: 0
> > > Hugepagesize: 1048576 kB
> > > ...
> > >
> > > 2) set nr_overcommit_hugepages
> > >
> > > echo 1
> > > >/sys/kernel/mm/hugepages/hugepages-1048576kB/nr_overcommit_hugepages
> > > cat
> > > /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_overcommit_hugepages
> > > 1
> > >
> > > 3) overcommit 2gb hugepages.
> > >
> > > mmap(NULL, 18446744071562067968, PROT_READ|PROT_WRITE, MAP_SHARED,
> > > 3,
> > > 0) = -1 ENOMEM (Cannot allocate memory)
> > >
> > > cat
> > > /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_overcommit_hugepages
> > > 18446744071589420672
> > >
> > > Signed-off-by: CAI Qian <caiqian@redhat.com>
> >
> > There are a couple of issues here: first, I think the overcommit value
> > being overwritten
> > is a bug and this needs to be addressed and fixed before we cover it
> > by removing the sysfs
> > file.
> >
> > Second, will it be easier for userspace to work with some huge page
> > sizes having the
> > overcommit file and others not or making the kernel hand EINVAL back
> > when nr_overcommit is
> > is changed for an unsupported page size?
> >
> > Finally, this is a problem for more than 1GB pages on x86_64. It is
> > true for all pages >
> > 1 << MAX_ORDER. Once the overcommit bug is fixed and the second issue
> > is answered, the
> > solution that is used (either EINVAL or no overcommit file) needs to
> > happen for all cases
> > where it applies, not just the 1GB case.
> I have a new patch ready to return EINVAL for both sysfs/procfs, and will
> reject changing of nr_hugepages. Do you know if nr_hugepages_mempolicy
> is supposed to be able to change in this case? It is not possible currently.
>
> # cat /proc/sys/vm/nr_hugepages_mempolicy
> 1
> # echo 0 >/proc/sys/vm/nr_hugepages_mempolicy
> # cat /proc/sys/vm/nr_hugepages_mempolicy
> 1
nr_hugepages_mempolicy should follow all the same rules WRT MAX_ORDER
as nr_hugepages. The difference is nr_hugepages_mempolicy respects
the NUMA allocation policy that is set.
I have a pair of patches that do about the same thing but instead of
altering flush_write_buffer, they make the functions that use
strict_strtoul in hugetlb.c return -EINVAL on error instead of 0.
The second patch is the same as your check for MAX_ORDER. I think that
returning -EINVAL from hugetlb.c makes better sense than changing the
behavior of flush_write_buffer. Patches will be on the way as soon as
I am sure they build.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
prev parent reply other threads:[~2011-01-05 16:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <2026935485.119940.1294126785849.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com>
2011-01-04 7:42 ` CAI Qian
2011-01-04 17:56 ` Eric B Munson
2011-01-05 5:02 ` CAI Qian
2011-01-05 7:31 ` CAI Qian
2011-01-05 11:36 ` CAI Qian
2011-01-05 15:02 ` CAI Qian
2011-01-05 16:44 ` Eric B Munson [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=20110105164434.GA3527@mgebm.net \
--to=emunson@mgebm.net \
--cc=caiqian@redhat.com \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
/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