From: Huang Shijie <shijie.huang@arm.com>
To: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Cc: akpm@linux-foundation.org, catalin.marinas@arm.com,
n-horiguchi@ah.jp.nec.com, mhocko@suse.com,
kirill.shutemov@linux.intel.com, aneesh.kumar@linux.vnet.ibm.com,
mike.kravetz@oracle.com, linux-mm@kvack.org, will.deacon@arm.com,
steve.capper@arm.com, kaly.xin@arm.com, nd@arm.com,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/2] mm: hugetlb: support gigantic surplus pages
Date: Tue, 8 Nov 2016 15:08:53 +0800 [thread overview]
Message-ID: <20161108070851.GA15044@sha-win-210.asiapac.arm.com> (raw)
In-Reply-To: <20161108021929.GA982@sha-win-210.asiapac.arm.com>
On Tue, Nov 08, 2016 at 10:19:30AM +0800, Huang Shijie wrote:
> On Mon, Nov 07, 2016 at 04:25:04PM +0100, Gerald Schaefer wrote:
> > On Thu, 3 Nov 2016 10:51:38 +0800
> > Huang Shijie <shijie.huang@arm.com> wrote:
> >
> > > When testing the gigantic page whose order is too large for the buddy
> > > allocator, the libhugetlbfs test case "counter.sh" will fail.
> > >
> > > The failure is caused by:
> > > 1) kernel fails to allocate a gigantic page for the surplus case.
> > > And the gather_surplus_pages() will return NULL in the end.
> > >
> > > 2) The condition checks for "over-commit" is wrong.
> > >
> > > This patch adds code to allocate the gigantic page in the
> > > __alloc_huge_page(). After this patch, gather_surplus_pages()
> > > can return a gigantic page for the surplus case.
> > >
> > > This patch also changes the condition checks for:
> > > return_unused_surplus_pages()
> > > nr_overcommit_hugepages_store()
> > >
> > > After this patch, the counter.sh can pass for the gigantic page.
> > >
> > > Acked-by: Steve Capper <steve.capper@arm.com>
> > > Signed-off-by: Huang Shijie <shijie.huang@arm.com>
> > > ---
> > > mm/hugetlb.c | 15 ++++++++++-----
> > > 1 file changed, 10 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> > > index 0bf4444..2b67aff 100644
> > > --- a/mm/hugetlb.c
> > > +++ b/mm/hugetlb.c
> > > @@ -1574,7 +1574,7 @@ static struct page *__alloc_huge_page(struct hstate *h,
> > > struct page *page;
> > > unsigned int r_nid;
> > >
> > > - if (hstate_is_gigantic(h))
> > > + if (hstate_is_gigantic(h) && !gigantic_page_supported())
> > > return NULL;
> >
> > Is it really possible to stumble over gigantic pages w/o having
> > gigantic_page_supported()?
> >
> > Also, I've just tried this on s390 and counter.sh still fails after these
> > patches, and it should fail on all archs as long as you use the gigantic
> I guess the failure you met is caused by the libhugetlbfs itself, there are
> several bugs in the libhugetlbfs. I have a patch set for the
> libhugetlbfs too. I will send it as soon as possible.
>
> > hugepage size as default hugepage size. This is because you only changed
> > nr_overcommit_hugepages_store(), which handles nr_overcommit_hugepages
> > in sysfs, and missed hugetlb_overcommit_handler() which handles
> > /proc/sys/vm/nr_overcommit_hugepages for the default sized hugepages.
> This is wrong. :)
Sorry, I was wrong :). The counters test does call the /proc/sys/vm/nr_overcommit_hugepages.
But in the arm64, it does not trigger a fail for the counters test.
In an other word, I did not change the hugetlb_overcommit_handler(),
the counters.sh also can pass in arm64.
I will look at the lockdep issue.
Thanks
Huang Shijie
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2016-11-08 7:39 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-03 2:51 [PATCH 0/2] mm: fix the "counter.sh" failure for libhugetlbfs Huang Shijie
2016-11-03 2:51 ` [PATCH 1/2] mm: hugetlb: rename some allocation functions Huang Shijie
2016-11-04 3:11 ` [PATCH] " Huang Shijie
2016-11-03 2:51 ` [PATCH 2/2] mm: hugetlb: support gigantic surplus pages Huang Shijie
2016-11-03 3:13 ` kbuild test robot
2016-11-07 15:25 ` Gerald Schaefer
2016-11-08 2:19 ` Huang Shijie
2016-11-08 7:08 ` Huang Shijie [this message]
2016-11-08 9:17 ` Huang Shijie
2016-11-08 19:27 ` Gerald Schaefer
2016-11-09 7:12 ` Huang Shijie
2016-11-09 7:08 ` [PATCH v2 " Huang Shijie
2016-11-09 15:55 ` Gerald Schaefer
2016-11-10 7:03 ` Huang Shijie
2016-11-03 17:22 ` [PATCH 0/2] mm: fix the "counter.sh" failure for libhugetlbfs Randy Dunlap
2016-11-04 1:59 ` Huang Shijie
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=20161108070851.GA15044@sha-win-210.asiapac.arm.com \
--to=shijie.huang@arm.com \
--cc=akpm@linux-foundation.org \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=catalin.marinas@arm.com \
--cc=gerald.schaefer@de.ibm.com \
--cc=kaly.xin@arm.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=mike.kravetz@oracle.com \
--cc=n-horiguchi@ah.jp.nec.com \
--cc=nd@arm.com \
--cc=steve.capper@arm.com \
--cc=will.deacon@arm.com \
/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