From: Huang Shijie <shijie.huang@arm.com>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: <dwoods@mellanox.com>, <steve.capper@arm.com>,
<will.deacon@arm.com>, <linux-kernel@vger.kernel.org>,
<kaly.xin@arm.com>, <akpm@linux-foundation.org>, <nd@arm.com>,
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 1/2] arm64: hugetlb: remove the wrong pmd check in find_num_contig()
Date: Fri, 4 Nov 2016 10:52:17 +0800 [thread overview]
Message-ID: <20161104025216.GA19810@sha-win-210.asiapac.arm.com> (raw)
In-Reply-To: <20161104001616.ssjbemliorxi6evl@localhost>
On Thu, Nov 03, 2016 at 06:16:16PM -0600, Catalin Marinas wrote:
> On Thu, Nov 03, 2016 at 10:27:38AM +0800, Huang Shijie wrote:
> > diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c
> > index 2e49bd2..4811ef1 100644
> > --- a/arch/arm64/mm/hugetlbpage.c
> > +++ b/arch/arm64/mm/hugetlbpage.c
> > @@ -61,10 +61,6 @@ static int find_num_contig(struct mm_struct *mm, unsigned long addr,
> > return 1;
> > }
> > pmd = pmd_offset(pud, addr);
> > - if (!pmd_present(*pmd)) {
> > - VM_BUG_ON(!pmd_present(*pmd));
> > - return 1;
> > - }
> > if ((pte_t *)pmd == ptep) {
> > *pgsize = PMD_SIZE;
> > return CONT_PMDS;
>
> BTW, for the !pud_present() and !pgd_present() cases, shouldn't
The kernel will not call the find_num_contig() if the PGD/PUD are empty.
Please see the code in the hugetlb_fault().
------------------------------------------------------
ptep = huge_pte_offset(mm, address);
if (ptep) {
...............................
} else {
ptep = huge_pte_alloc(mm, address, huge_page_size(h));
if (!ptep)
return VM_FAULT_OOM;
}
------------------------------------------------------
Thanks
Huang Shijie
> find_num_contig() actually return 0? These are more likely real bugs, so
> no point in setting the huge pte.
next prev parent reply other threads:[~2016-11-04 3:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-03 2:27 [PATCH 0/2] arm64: fix the bugs found in the hugetlb test Huang Shijie
2016-11-03 2:27 ` [PATCH 1/2] arm64: hugetlb: remove the wrong pmd check in find_num_contig() Huang Shijie
2016-11-04 0:16 ` Catalin Marinas
2016-11-04 2:52 ` Huang Shijie [this message]
2016-11-04 15:48 ` Catalin Marinas
2016-11-08 2:25 ` Huang Shijie
2016-11-03 2:27 ` [PATCH 2/2] arm64: hugetlb: fix the wrong address for several functions 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=20161104025216.GA19810@sha-win-210.asiapac.arm.com \
--to=shijie.huang@arm.com \
--cc=akpm@linux-foundation.org \
--cc=catalin.marinas@arm.com \
--cc=dwoods@mellanox.com \
--cc=kaly.xin@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--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
all inboxes | Powered by JetHome®