From: Saurabh Singh Sengar <ssengar@linux.microsoft.com>
To: Yu Zhao <yuzhao@google.com>
Cc: ssengar@microsoft.com, akpm@linux-foundation.org, jack@suse.cz,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
jostarks@microsoft.com, Matthew Wilcox <willy@infradead.org>,
Dan Williams <dan.j.williams@intel.com>
Subject: Re: [PATCH] mm/gup: fix gup_pud_range() for dax
Date: Tue, 6 Dec 2022 21:40:18 -0800 [thread overview]
Message-ID: <20221207054018.GB23765@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> (raw)
In-Reply-To: <CAOUHufbkcdyg8RAEa08DvKE=+bsxjuReiP4iscTV99sZ1oBQ2g@mail.gmail.com>
On Thu, Oct 20, 2022 at 04:18:37PM -0600, Yu Zhao wrote:
> On Thu, Oct 20, 2022 at 12:14 PM Saurabh Sengar
> <ssengar@linux.microsoft.com> wrote:
> >
> > From: John Starks <jostarks@microsoft.com>
> >
> > For dax pud, pud_huge() returns true on x86. So the function works as long
> > as hugetlb is configured. However, dax doesn't depend on hugetlb.
> > Commit 414fd080d125 ("mm/gup: fix gup_pmd_range() for dax") fixed
> > devmap-backed huge PMDs, but missed devmap-backed huge PUDs. Fix this as
> > well.
> >
> > Fixes: 414fd080d125 ("mm/gup: fix gup_pmd_range() for dax")
> > Signed-off-by: John Starks <jostarks@microsoft.com>
> > Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
> > ---
> > mm/gup.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/mm/gup.c b/mm/gup.c
> > index 05068d3d2557..9e07aa54a4cd 100644
> > --- a/mm/gup.c
> > +++ b/mm/gup.c
> > @@ -2687,7 +2687,7 @@ static int gup_pud_range(p4d_t *p4dp, p4d_t p4d, unsigned long addr, unsigned lo
> > next = pud_addr_end(addr, end);
> > if (unlikely(!pud_present(pud)))
> > return 0;
> > - if (unlikely(pud_huge(pud))) {
> > + if (unlikely(pud_huge(pud) || pud_devmap(pud))) {
>
> Perhaps s/pud_huge/pud_leaf/ ?
Looks good to me but I am not sure the wider impact of this, I will let maintainers
comment on it. Meanwhile I will send a V2 with more description of panic observed.
>
> > if (!gup_huge_pud(pud, pudp, addr, next, flags,
> > pages, nr))
> > return 0;
> > --
> > 2.25.1
> >
prev parent reply other threads:[~2022-12-07 5:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-20 18:14 Saurabh Sengar
2022-10-20 22:18 ` Yu Zhao
2022-12-07 5:40 ` Saurabh Singh Sengar [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=20221207054018.GB23765@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net \
--to=ssengar@linux.microsoft.com \
--cc=akpm@linux-foundation.org \
--cc=dan.j.williams@intel.com \
--cc=jack@suse.cz \
--cc=jostarks@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ssengar@microsoft.com \
--cc=willy@infradead.org \
--cc=yuzhao@google.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