From patchwork Fri Jan 11 03:40:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Zhao X-Patchwork-Id: 10757235 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 57C6413B4 for ; Fri, 11 Jan 2019 03:40:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 41B6C29D61 for ; Fri, 11 Jan 2019 03:40:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 35B2029D65; Fri, 11 Jan 2019 03:40:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE97D29D61 for ; Fri, 11 Jan 2019 03:40:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 75AE98E0002; Thu, 10 Jan 2019 22:40:40 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 6E1668E0001; Thu, 10 Jan 2019 22:40:40 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5AB558E0002; Thu, 10 Jan 2019 22:40:40 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-it1-f199.google.com (mail-it1-f199.google.com [209.85.166.199]) by kanga.kvack.org (Postfix) with ESMTP id 2E0658E0001 for ; Thu, 10 Jan 2019 22:40:40 -0500 (EST) Received: by mail-it1-f199.google.com with SMTP id y86so253446ita.2 for ; Thu, 10 Jan 2019 19:40:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:mime-version:content-transfer-encoding; bh=lZnGDXsUQbwyjh5UWj+6dF6AsWEY4vPnZvvvUR0vmyo=; b=R443yuDtXF8RwmFBosrJEbLGNgaWlM8Sw+fkr0Zb+pyshnls+GoNzDW/8aCW3TkXJR 8niFRuOZz6mMvqWY0ImqJn3+CgBsFyZ5o52O5PcCUVAvKojhd/DMXuWLKzu74DWN1gqx ETWNWuKNlhErckKRmTMpxOiYdQDZ6FBWgIulkrHhF7lOcM4aShjbdhYsh9uKFy+ZBh+X /A9b1DiJyXgetXYt1QmCf3BFhcptxCjDwbaMcJwEp1BkWD8ofCe0WR4yegexHUxJ2/V0 bRppaCa8YEND+qjPtygFN/cVE6QbrL6+fwzgPLFqxlymEqp3/7fkQ3FN8Zo+HhG9IQM9 SRUg== X-Gm-Message-State: AJcUukf1RoI3omA/OQWV64O+ldq/NsZWGMBBfSM9tlBlw1FJR5dp4GTI qoeoZuPfu/C0HgLiFuYe1hriGTAFvvd8xj5XPUaaFpbXFUQtbUlEGACoMMEEvBzE+xt77G0grgM bw/D/9lOoaQqb/cuGRLHeu6nu1jYTU6dsaeWdL9ukD0DG3cOOjrfYyQ7ZgRDFWRI9h49NKzLggi pVGcfM+/18EqgL7wg8NCLxd4aZkzkmxd7CFrenfwIb3zUjah7emBUeeNEqiUcsol0gRtoDxulBH /SqBwAMmIcc3Q+azmwKbrpU8+ut+avG52jI6WKidXVsxoUWRmDqjX2XoxPuSYVASZJsXReZT068 su8vkq8q1YpZRBcLQVVvdvcTTs0kMFSIV0FtipK+GynNgnReA31KExUKIlolb3EyXYa97HiPQtl e X-Received: by 2002:a02:5184:: with SMTP id s126mr8848322jaa.12.1547178039961; Thu, 10 Jan 2019 19:40:39 -0800 (PST) X-Received: by 2002:a02:5184:: with SMTP id s126mr8848307jaa.12.1547178039331; Thu, 10 Jan 2019 19:40:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547178039; cv=none; d=google.com; s=arc-20160816; b=y1F4/JogTgHmPEybLSA5XJ24EFER8LtD9Fm0W+KUDECLwwR2xTOQogRnhsCc/E/2LQ ovxOfHcTBuAgA2Dg7pd8yroNeFcO4+IN9ekfiC9xA1RYOEe3M0FJnBDdwHoqm0/HBMZf vRoMmr6KW0rpRExA/VupO1szh6YaWuX4acouuBHe2ze+MwnECg+K3Mitm41Nv6sw8OLp XWcNR9tK8BmX0XAE92CbUwXzqwgKZWTjYjyfVftUEleHl835nyZ1vM45Lepg2sBorcAB 34Zce6u0E672kg0ZH1YIpfHE4XsNxp5zEFJO+T19Avbc4j1MsEc9yH8iH0rMLTHCWan/ w7+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=lZnGDXsUQbwyjh5UWj+6dF6AsWEY4vPnZvvvUR0vmyo=; b=RQdKLvD5G9TR/uKyA7086HnUMlDSSO/HS/O+QaDTq/6LZ//I6o8aJzgdxwiaqwgesw tetTRp+UhrFJlyI+Zd4PWNqZB6QCY8hyiwZmg6U5iS5kbMkENzGL7TG2Rw5t0cFy3Ylb B0m+3Hl+xSYvX8Qv+8Dy3V2nVC/vr5NULR8936K0HbAn2xjYk7HeCQDIaOQmipHv43Fj avDwfZh3lj/AIs6lEgLwCQM+nXCFDWxfV5iGOFIkXu6G6Zf5riVNTdjXYgxLcXtbdpnq 2Ivj6YsjcPG7IwYlO7DirOqmR9ZiRRS47wQXdNaGeA5fPq7rIYpt1174+UPETFMemrgU OMOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=LxEgSbhW; spf=pass (google.com: domain of yuzhao@google.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=yuzhao@google.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id h3sor484861jaa.13.2019.01.10.19.40.39 for (Google Transport Security); Thu, 10 Jan 2019 19:40:39 -0800 (PST) Received-SPF: pass (google.com: domain of yuzhao@google.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=LxEgSbhW; spf=pass (google.com: domain of yuzhao@google.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=yuzhao@google.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=lZnGDXsUQbwyjh5UWj+6dF6AsWEY4vPnZvvvUR0vmyo=; b=LxEgSbhWieOrJRL7WdJReUC/jQ/8NbBZM2fGYvsWjwXICsBs2o2VjL2+FIzMLar8Xp LL4Gmn3TCZinoCZVY94UV+JxVWfGOQTdpHxkOSodQ3FNcDtkgPC8AI3bEVyP5QBEODAC u2bYZ8zF/EXhy5RSQo2EOp1iRZPMdrXCvktBqNZJo6uDL9YZDnQPi18YZkRz7+n/Gwsn FKcKxVjLUewR4YPaRPxvWqxEQddD+MzINe8Dq9ybv+rTq/Txstke2sKaqkEOxtqXqQbX lCPNrJPX2dWbyLwH3IhHbyMIxduOJVyAIEhRD39OsFE2US0QZmhLVis30V0Ax402DtVj hB7g== X-Google-Smtp-Source: ALg8bN7sio0Vo33V1lV3U3ZiGgUQ2Ue5bsmHsk2cFVEHLdOlS5SQl9yOrOG96DLmyuIN+sR+Wkn2Zg== X-Received: by 2002:a02:1a0a:: with SMTP id 10mr8930908jai.50.1547178038583; Thu, 10 Jan 2019 19:40:38 -0800 (PST) Received: from yuzhao.bld.corp.google.com ([2620:15c:183:0:a0c3:519e:9276:fc96]) by smtp.gmail.com with ESMTPSA id x99sm165095ita.23.2019.01.10.19.40.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Jan 2019 19:40:37 -0800 (PST) From: Yu Zhao To: Andrew Morton , Dan Williams , Huang Ying Cc: Matthew Wilcox , Keith Busch , "Michael S . Tsirkin" , Jan Kara , John Hubbard , Wei Yang , Mike Rapoport , Andrea Arcangeli , linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Kirill A . Shutemov" , Yu Zhao Subject: [PATCH] mm/gup: fix gup_pmd_range() for dax Date: Thu, 10 Jan 2019 20:40:33 -0700 Message-Id: <20190111034033.601-1-yuzhao@google.com> X-Mailer: git-send-email 2.20.1.97.g81188d93c3-goog MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP For dax pmd, pmd_trans_huge() returns false but pmd_huge() returns true on x86. So the function works as long as hugetlb is configured. However, dax doesn't depend on hugetlb. Signed-off-by: Yu Zhao --- mm/gup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/gup.c b/mm/gup.c index 05acd7e2eb22..75029649baca 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -1674,7 +1674,8 @@ static int gup_pmd_range(pud_t pud, unsigned long addr, unsigned long end, if (!pmd_present(pmd)) return 0; - if (unlikely(pmd_trans_huge(pmd) || pmd_huge(pmd))) { + if (unlikely(pmd_trans_huge(pmd) || pmd_huge(pmd) || + pmd_devmap(pmd))) { /* * NUMA hinting faults need to be handled in the GUP * slowpath for accounting purposes and so that they