Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1640521rwi; Thu, 20 Oct 2022 15:29:02 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5gSn+r/Zbz+dHEaIrPdHP11iz9V68X6vWVpyQsGtwt3c6z4syMBRSTve/FjLSvfXOiZwRz X-Received: by 2002:a17:90b:2248:b0:210:10dc:a314 with SMTP id hk8-20020a17090b224800b0021010dca314mr10691023pjb.15.1666304942114; Thu, 20 Oct 2022 15:29:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666304942; cv=none; d=google.com; s=arc-20160816; b=fjxtndzIn1jFkMqKa7G33DwmX9xTCFQA3JKxrxSP6ia7MM4WdvcTRDggknjJthgi67 cOeZKMnhuB7iZcUr04E4KekUny1S4H+Ay3Q99Sei705vQihm8SNgXF1ZQhi5lO6l4KXp ot72ZxoZ+USpcDau7aafDNwO+YVZwLL/+YavO/yeKxnz8Tv841LpX9CNzUu6PFjaeZ0G +8+vE12tyMNWVvfFfvPjHavy7545EP2tl9MM/vkQt5DBxa6Ip15qLU2zB6iogfEwvEph auLQ3ZsRjt7EiN7i5RhS+2nKrO9XW/k88jI64xsUJn93fp2cU2JSBX6LTLiie0/dFIIT lFOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=yPAtFjxnM9QnPlCbiawpwzjKWBbf/HX4WSc2JVqLBOY=; b=OFEUM2YU7lirgVPM+9t3bX/fxL8H67/Kz+weAdBkNC2fE5IXFjXwUM+r9xZ/N8CXIJ i1ljkjEN4BC+WPny+6LoZPFDbIqC7p6V007MaaqIX7rb17fJcMV5esDvdXkdK/4Cpz8y bkmoLDrcF9cSObA+D0nx2yquBHI27sRLybNLqKYZzw4xtAVE/uY6lssbMZte9M/e6W0b r8eDrb8MkOPwffjQFkIpULebrmv2Qiv0Bi6pNORCKoYq09DBpojQITpAqwVFH3uCiifO 0ph+81YzrK4ofyWYk7+Z3YJmHxWCTvBwtKW4q5fWLdSF+ux7aOrQ+ZQDpoaqUhLrh9b2 mrKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=O84ATMDl; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 17-20020a630311000000b0043090081d69si22743588pgd.82.2022.10.20.15.28.49; Thu, 20 Oct 2022 15:29:02 -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=@google.com header.s=20210112 header.b=O84ATMDl; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229915AbiJTWTc (ORCPT + 99 others); Thu, 20 Oct 2022 18:19:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229925AbiJTWT3 (ORCPT ); Thu, 20 Oct 2022 18:19:29 -0400 Received: from mail-vk1-xa33.google.com (mail-vk1-xa33.google.com [IPv6:2607:f8b0:4864:20::a33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2C5422B3A0 for ; Thu, 20 Oct 2022 15:19:14 -0700 (PDT) Received: by mail-vk1-xa33.google.com with SMTP id y129so538673vkg.8 for ; Thu, 20 Oct 2022 15:19:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=yPAtFjxnM9QnPlCbiawpwzjKWBbf/HX4WSc2JVqLBOY=; b=O84ATMDl80Y3SemMzzwQ8EhGpuSf7ld5bfiznIEopm2rGgtJ2AVff2EKS4z/g8jvTY TJ6ZQhu7eyriq8P5/K15dRBQhTAfMSJ+7o7KzFVtV3sgCdVxWauKyzIl08agFdTedz3Y irvKUAJktENQYFrv8APfpioWxRUhrGliDoj9F2tT+0H0vZdE0rckcKhXI6YJ+8yloUVa jbt+raQSAqWX2CUGU2pPAs9icMIgJRQZShjYbgpAkxgPlg6IuxAwG9v16Yv417TJnEc3 blZ7tpFUJGB9fjfkFlBd1hLZK7WCCOHcxjHC08Br+8ru/MXjmXbf2gdYDMNyYI3aA5xx 4lxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=yPAtFjxnM9QnPlCbiawpwzjKWBbf/HX4WSc2JVqLBOY=; b=B3llGa6rERJ1GTCxkh7IqY3dXlmDWa2cv9k9gamdnW4idKWVL6N3dpB0kWX+BWQGX8 RSegyD2eIIjNgRB0mVQBBUVlqTX96iHjijjWyRIRIzxw2ZabS2iI49Li5hym201kL6fg OfnpjoG0KA72+nFFM88igZjhSAxQNmpDCI+HsGB1BKWn7sdeJddKyws9pEd0s+LC0rX8 ZjjdOziEXzOYAT86M+ORMdFXir9TXCeab2kvuOv/SZB8xGSI/xY+4OXHtbnegcajM754 OFFeMqlObxwfL3kyKDtwuRFCJKg0UmJfPTzKdhJxFNIqHkfduVIbRIybu/eMJ4pmjq5b LtCw== X-Gm-Message-State: ACrzQf3vr28VqkK3suMoxaZH84oJJhmYlJPU8NCgT0vyLnNXp2l5Tc85 jN5cnHVQK4fiO7DYa74zErsYMzlKUFXKGvVcr0AdTv+FLz7+jA== X-Received: by 2002:a1f:b453:0:b0:3ab:2c49:57df with SMTP id d80-20020a1fb453000000b003ab2c4957dfmr8495848vkf.29.1666304353774; Thu, 20 Oct 2022 15:19:13 -0700 (PDT) MIME-Version: 1.0 References: <1666289686-22798-1-git-send-email-ssengar@linux.microsoft.com> In-Reply-To: <1666289686-22798-1-git-send-email-ssengar@linux.microsoft.com> From: Yu Zhao Date: Thu, 20 Oct 2022 16:18:37 -0600 Message-ID: Subject: Re: [PATCH] mm/gup: fix gup_pud_range() for dax To: Saurabh Sengar 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 , Dan Williams Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 On Thu, Oct 20, 2022 at 12:14 PM Saurabh Sengar wrote: > > 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))) { Perhaps s/pud_huge/pud_leaf/ ? > if (!gup_huge_pud(pud, pudp, addr, next, flags, > pages, nr)) > return 0; > -- > 2.25.1 >