Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1364289rwi; Thu, 20 Oct 2022 11:30:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6kzQJNRMIM799OKFTT8RBO67KMRbJLOiQPgCM/B9PO0HssZTqXRcZqERckqesdzVLR3rfE X-Received: by 2002:a17:90b:4d05:b0:202:ec78:9d73 with SMTP id mw5-20020a17090b4d0500b00202ec789d73mr17442519pjb.103.1666290653354; Thu, 20 Oct 2022 11:30:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666290653; cv=none; d=google.com; s=arc-20160816; b=GpomA/kio1PcUBkpLj77wBu3kETUu9EK/I7X2gjWTy3PvfB17KR9hUntSlcdF/y52d wG4dfn8vcxPMbkq9NRgT87AXld++whZkkF+GyMsNV0E5YEH3FqkwA/CiNQeuIXU3L9jy z5x7cmWwD9tmQscXuByrTuetK8mZQNyn4lZjrDNxITaMVhJdyuDWOTbzRMboHxYDadCD SOQlvDIbQBRM7E5/1Hb1Rv1oSVcl5OCLqx/Aa0ffh4CgzDYJGjonrNPrG0We8GlgC5wL zAnJd070qNQ6OrEuyH+lafFox7Q3dfcB8gU5S/abmHlqfvbrplANQELeFIad3U2UcxxB HIcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:to:from:dkim-signature :dkim-filter; bh=ur8sScAym4ijq/4v4hHXNXCn8sXMfCruhdPnVBD9Zds=; b=jM93lIRAgbRHoYrTshCk3Jm4sJKlnbZTnpW5Ux9eJ3xJ+8IHcausbQoiP8ZpBYWoWC 2HBiyeQ3mbRcyF3XNj+1Tco1FdDlxFAWw5NsOS4JlmLOMjSUWE/S2iUkdNFy/lOttHd7 7n7f6gsMJDH4xvdPN7SirSC+ABoBuXFdiJpumKUBZF6FdI67tZIUNqoGFKHUZ45Wi/LC x5JNQTtqHMypBTOalZ6wfeORJweEPslDBFTmtDASbkVKxiyCxOTAJjM+HuN7L+Ofa61E VaRz6K2nQSpNxBS1JBSfsLdx743T9WR0ZSdUNm7vXf2qeZWSSbGKz9CizpF0EmSK1tGt fi4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=aGdm5Sd5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l11-20020a170903244b00b001780ba6c694si25099663pls.35.2022.10.20.11.30.41; Thu, 20 Oct 2022 11:30:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=aGdm5Sd5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229931AbiJTSO5 (ORCPT + 99 others); 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 X-Spam-Status: No, score=-19.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, 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; -- 2.25.1