Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp50884pxm; Wed, 2 Mar 2022 10:13:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJxonA15a1UWOVAhXiAcbpH1yS5xat1Z633CItVk9MAJMz993KdGLQnNPW6mqRnQs+dEpZCI X-Received: by 2002:a17:906:9605:b0:6cd:47e8:3b5e with SMTP id s5-20020a170906960500b006cd47e83b5emr23330534ejx.360.1646244792122; Wed, 02 Mar 2022 10:13:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646244792; cv=none; d=google.com; s=arc-20160816; b=w0jeSZXhxYsEgcWlgkH3XZoelAHHzJoJw//4UjS1GgJhOIibb3+CHJ7UgNwzBxCfCa eu8gIj6M1Sb50f8MypfjID0fTTjJ6HCnrvctea4ZjHa9YwyaflVgXqxd4tkSBk8A8X5R 8JMp6iafkE7M8sE4xNLRTJUWVb1fBGCHLDNniwD2U+bMpO5ipEt0KjRnVjdIT6d+Y6hi yf5JnX5ENL0n6W2gNUzdCreIDdTwa7J3tLFdxzeeElAezc4NQgky8b7BTrtmWdM8uNjV +BAcqPJpIzpdeT4jvlfY4rH3OhQ19Vz/oeKXbG6iw8Zoo6tyHXlaDm7nUq5M5AmuqDIx Uu/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=l/myAdjexodhPdxGEM0MHuk2V1UzL2hIaRiiu46o6gA=; b=f52FaXfmU+dnRyi3YQsb3FvxMDkbhXwMF2/rfVt6uplVqWfBCJSoX9RXjYB2tjGPd0 ET3fd4u/VUY0GV6ZvzHGBn9OI6e8MJ1tDq0ilocU7AuAPxitsL7sJEVNBPNo4TcnqNvl oDerWooPWdpWpbKZOLFn2izN8ME1/m1/X6EpJz8r2VcrgKjR8GZ4yqHOl1bKwrByVJJM all+w5GQi7UoVqctK1NFWCF/bdGgcbLXpukS5ZQ5qVcYthMP09+8Dzq4NW+QPu0AWelk 5S7sPnGLKx4rkkc9aOt5OfaXqdGAvurgsbB88mr2WVWUA90mdckHgASOXYQ7AFqpApZ5 sHXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=5wCqMdPr; 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=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qf31-20020a1709077f1f00b006da8440d649si373725ejc.467.2022.03.02.10.12.49; Wed, 02 Mar 2022 10:13:12 -0800 (PST) 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=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=5wCqMdPr; 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=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240143AbiCBIad (ORCPT + 99 others); Wed, 2 Mar 2022 03:30:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240136AbiCBIaX (ORCPT ); Wed, 2 Mar 2022 03:30:23 -0500 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CF77B8B43 for ; Wed, 2 Mar 2022 00:29:38 -0800 (PST) Received: by mail-pj1-x1036.google.com with SMTP id mg21-20020a17090b371500b001bef9e4657cso793698pjb.0 for ; Wed, 02 Mar 2022 00:29:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=l/myAdjexodhPdxGEM0MHuk2V1UzL2hIaRiiu46o6gA=; b=5wCqMdPra7WU6QtB0HKKqpqInbC0mjKYJvNn1TUItnMFQQUxMLnPC8gOImTQQjrUJ6 lxZPmTjDu1L0Q72qlAPkPaRlENO07rpX9UYXO0FAF59aYEtozl+ZKAWQZ8W3qqRE+ikr SlRgQWIHHhcTtdgRhGo4D22XRHAZBBeblqRndIow0K+xwrQOm5CHH/9Z9ixzQe6h7kFE zNljQhcoRBU9180TzWuXPS9NCuP82R0Fe0PKzpYQqkyaXnxFW5Nt5cxWBJuTk3L4oHxt KISVkpNb+bLAdydzsYyxsQZ+ibl5wXiET/Dx7dQOH8lcVFxHxuZfrkdIRaRw8w+oE5Al xSiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=l/myAdjexodhPdxGEM0MHuk2V1UzL2hIaRiiu46o6gA=; b=UUp81c4a94j0+vRA5RhX5pE1U2YNe17aGWoYYOKhMlXM6If1pwS42CzkAbVrVy20ED vvzlUQbQlNzh+iIUIW4X6htQIqASqGv1vD86FMIxD+j17fBkwa5pLYt9Jp2ecRe4QsZq +H6S2m4ZRv+EaX9pdRwHtUduPkpHqe6c25j8yXHMJHWb8o/+0ss8ws/aYdPBxzPBtB6j VADcANCxR8XesgQ48MIBoiCYfQB6GctZk4lZH+TIG4NfOAlgaNHgs0oYWDwnsmuadyp8 aeGRmUyhNvPB6rkVQjK/7QGvIwC3SuJBKRwIYbWykfMlwHm36LeXjuYrVvUh7G+QMhV7 bsqA== X-Gm-Message-State: AOAM530mBhZlwjCM1YNTJewMMnio30XJw29RMPA8CdSiRT3eINl3xgK9 iQb+Zcjy4uw/U89j5kZ2GvJejw== X-Received: by 2002:a17:902:e549:b0:150:2412:c94c with SMTP id n9-20020a170902e54900b001502412c94cmr26221501plf.94.1646209777959; Wed, 02 Mar 2022 00:29:37 -0800 (PST) Received: from FVFYT0MHHV2J.bytedance.net ([61.120.150.70]) by smtp.gmail.com with ESMTPSA id a20-20020a056a000c9400b004f396b965a9sm20922228pfv.49.2022.03.02.00.29.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 00:29:37 -0800 (PST) From: Muchun Song To: dan.j.williams@intel.com, willy@infradead.org, jack@suse.cz, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, apopple@nvidia.com, shy828301@gmail.com, rcampbell@nvidia.com, hughd@google.com, xiyuyang19@fudan.edu.cn, kirill.shutemov@linux.intel.com, zwisler@kernel.org, hch@infradead.org Cc: linux-fsdevel@vger.kernel.org, nvdimm@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org, duanxiongchun@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v4 4/6] mm: pvmw: add support for walking devmap pages Date: Wed, 2 Mar 2022 16:27:16 +0800 Message-Id: <20220302082718.32268-5-songmuchun@bytedance.com> X-Mailer: git-send-email 2.32.0 (Apple Git-132) In-Reply-To: <20220302082718.32268-1-songmuchun@bytedance.com> References: <20220302082718.32268-1-songmuchun@bytedance.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 The devmap pages can not use page_vma_mapped_walk() to check if a huge devmap page is mapped into a vma. Add support for walking huge devmap pages so that DAX can use it in the next patch. Signed-off-by: Muchun Song --- mm/page_vma_mapped.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/page_vma_mapped.c b/mm/page_vma_mapped.c index 1187f9c1ec5b..f9ffa84adf4d 100644 --- a/mm/page_vma_mapped.c +++ b/mm/page_vma_mapped.c @@ -210,10 +210,11 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw) */ pmde = READ_ONCE(*pvmw->pmd); - if (pmd_trans_huge(pmde) || is_pmd_migration_entry(pmde)) { + if (pmd_trans_huge(pmde) || pmd_devmap(pmde) || + is_pmd_migration_entry(pmde)) { pvmw->ptl = pmd_lock(mm, pvmw->pmd); pmde = *pvmw->pmd; - if (likely(pmd_trans_huge(pmde))) { + if (likely(pmd_trans_huge(pmde) || pmd_devmap(pmde))) { if (pvmw->flags & PVMW_MIGRATION) return not_found(pvmw); if (!check_pmd(pmd_pfn(pmde), pvmw)) -- 2.11.0