From: Saurabh Singh Sengar <ssengar@linux.microsoft.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: ssengar@microsoft.com, yuzhao@google.com, jack@suse.cz,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
jostarks@microsoft.com
Subject: Re: [PATCH v2] mm/gup: fix gup_pud_range() for dax
Date: Wed, 7 Dec 2022 20:08:41 -0800 [thread overview]
Message-ID: <20221208040841.GA19421@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> (raw)
In-Reply-To: <20221207133130.f4894372d295f99fd4954255@linux-foundation.org>
On Wed, Dec 07, 2022 at 01:31:30PM -0800, Andrew Morton wrote:
> On Tue, 6 Dec 2022 22:00:53 -0800 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.
> >
> > This fixes the below kernel panic:
> >
> > ...
> >
> > Fixes: 414fd080d125 ("mm/gup: fix gup_pmd_range() for dax")
>
> Feb 2019.
>
> > 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 c2c2c6d..e776540 100644
> > --- a/mm/gup.c
> > +++ b/mm/gup.c
> > @@ -2765,7 +2765,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))) {
> > if (!gup_huge_pud(pud, pudp, addr, next, flags,
> > pages, nr))
> > return 0;
>
> I assume this should be backported into -stable kernels?
That would be helpful, thanks.
prev parent reply other threads:[~2022-12-08 4:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-07 6:00 Saurabh Sengar
2022-12-07 21:31 ` Andrew Morton
2022-12-08 4:08 ` 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=20221208040841.GA19421@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net \
--to=ssengar@linux.microsoft.com \
--cc=akpm@linux-foundation.org \
--cc=jack@suse.cz \
--cc=jostarks@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ssengar@microsoft.com \
--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