From nobody Tue Apr 7 23:39:15 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44746C4332F for ; Thu, 20 Oct 2022 18:14:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230040AbiJTSO5 (ORCPT ); Thu, 20 Oct 2022 14:14:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229742AbiJTSOy (ORCPT ); Thu, 20 Oct 2022 14:14:54 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A55D63DBCC for ; Thu, 20 Oct 2022 11:14:51 -0700 (PDT) Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id 50BB420477CE; Thu, 20 Oct 2022 11:14:50 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 50BB420477CE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1666289690; bh=ur8sScAym4ijq/4v4hHXNXCn8sXMfCruhdPnVBD9Zds=; h=From:To:Subject:Date:From; b=aGdm5Sd5dRnM54VEat6X0IA6HURGs2w6iDFe1M5AjRDo+qOYJGIkBoAjhec+7pOXf Su/Ht7+8b0sj4sMAL4q3aqMM6Msd6gKq6Mz0zVOnpT3LvVRocGTUciRTrT43/edgu5 EV+LQBrQHqwS5Ru4noDwXZxPph2C39m+VXqFTBwc= From: Saurabh Sengar To: ssengar@microsoft.com, akpm@linux-foundation.org, yuzhao@google.com, jack@suse.cz, linux-mm@kvack.org, linux-kernel@vger.kernel.org, jostarks@microsoft.com Subject: [PATCH] mm/gup: fix gup_pud_range() for dax Date: Thu, 20 Oct 2022 11:14:46 -0700 Message-Id: <1666289686-22798-1-git-send-email-ssengar@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: John Starks 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 Signed-off-by: Saurabh Sengar --- 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, unsi= gned long addr, unsigned lo next =3D 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; --=20 2.25.1