Message ID | 20230105101844.1893104-23-jthoughton@google.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F58EC3DA7A for <linux-mm@archiver.kernel.org>; Thu, 5 Jan 2023 10:19:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 106AB940013; Thu, 5 Jan 2023 05:19:30 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0DE59940008; Thu, 5 Jan 2023 05:19:30 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E992A940013; Thu, 5 Jan 2023 05:19:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id DA0B1940008 for <linux-mm@kvack.org>; Thu, 5 Jan 2023 05:19:29 -0500 (EST) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 939241C64FB for <linux-mm@kvack.org>; Thu, 5 Jan 2023 10:19:29 +0000 (UTC) X-FDA: 80320348458.28.2493AD9 Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) by imf16.hostedemail.com (Postfix) with ESMTP id 0AB05180005 for <linux-mm@kvack.org>; Thu, 5 Jan 2023 10:19:27 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=PMdoUglm; spf=pass (imf16.hostedemail.com: domain of 3L6S2YwoKCHYdnbioabnihaiiafY.Wigfchor-ggepUWe.ila@flex--jthoughton.bounces.google.com designates 209.85.219.201 as permitted sender) smtp.mailfrom=3L6S2YwoKCHYdnbioabnihaiiafY.Wigfchor-ggepUWe.ila@flex--jthoughton.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1672913968; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=nuChqEE6EgS9ZWad0RFM9vhCC4fCrQA1CHpyknS9e9I=; b=6i2v229bWXy1Dz/RYcQ9wZXk4fhSPz9DBTLzsSOc431a4QzZ0/nDFFtXBfpgju/EiBCuqR 2Jg13Vw6FyJ8y/K2WNQpdIvvo4APW/vLHCZjn1uzj8pn7KYkqpCBlu0CfpzYzt4Go/m0le UVI7k/3Qlrmgp3XpfwOI6m+rGqFxCsg= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=PMdoUglm; spf=pass (imf16.hostedemail.com: domain of 3L6S2YwoKCHYdnbioabnihaiiafY.Wigfchor-ggepUWe.ila@flex--jthoughton.bounces.google.com designates 209.85.219.201 as permitted sender) smtp.mailfrom=3L6S2YwoKCHYdnbioabnihaiiafY.Wigfchor-ggepUWe.ila@flex--jthoughton.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1672913968; a=rsa-sha256; cv=none; b=CPQqdSM/MAVdAZav5BnsfRLrupxNDtcI0zwVXdR8QdghV0tb52Zbsw+NJEWxwjODzGDOeJ 7TQN2OhAuwfEo9nZMh9D7BfjjvnpxrQaxFgzxFIpyQe1cPh65F8Sw0HxHe7I7JY7PJEBvj LYT8L5/j2xXHd5UAYgkZT90uBVqzg74= Received: by mail-yb1-f201.google.com with SMTP id v9-20020a259d89000000b007b515f139e0so1269725ybp.17 for <linux-mm@kvack.org>; Thu, 05 Jan 2023 02:19:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=nuChqEE6EgS9ZWad0RFM9vhCC4fCrQA1CHpyknS9e9I=; b=PMdoUglmYM3qm6mWAqtyVJgzu77MRJxWmvYG3y/y52hzYvzk3AeSDZU/v2V/pwhi1f AihoMvQwpu8u1lszjJmu97VBPUPHphQwGK+Wi8ukPijxmNbY6TtoExxE1zmWstSCaeED T5Ii9p6OfjRqSgGbZeKD1Y0Rzcm0Fdvj3xukaysFr/AEQaLMJgbLYNRWvM54l3lHDA7x fl11csrpr58Kd28oGSDnxgd7q6xGmGLlKrMpRBTnVtv5V+fe2oSKpXRf+O+a4IQLcoCC PuKdMBIByP3sRXz/ggMAPuiyizC3+IXS18St1U3mOWfSpY1iHbA15ZXf/yxY1pQexB6C posA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=nuChqEE6EgS9ZWad0RFM9vhCC4fCrQA1CHpyknS9e9I=; b=DzmuDuhW0xijRawV5ZMxhBHqpdXZBEhjoG11nrc5++wfKZbD4CHBWmPwVoB+XlJAvE +ET6aDx6lcgpV0cOBuM6ceaKe8QFk3/IJQBVG/SfgbgyJvByj6Hc6n9M5AtYUsZKnUyB pbH2J9htyJCs+RUuYvxt9+zNdaYWjpurWm38DT+kISxTNwIZ4PkAgRnU6G9pQeQVzCYM NTUEvYtdIp3jZgs3KzcbNQcBKaVD3tX33zi5ok3CwLqr5EbIHZdGpgUu/Lu3NOutTujm nj3x4UX5F2wCmF1i7XMIO5uRsvsqwsviSNFH8lT47wCQl3orIa1sLX5LqDqhWIA+7ZOp uO1g== X-Gm-Message-State: AFqh2kryEJLY1PvntKnZ88FG2WRBb9fao76ZF6brrbl+DnY+SlDOzVUm I9F/JsCJ6qg2eQVlpe9fil6A18nvrntTkok2 X-Google-Smtp-Source: AMrXdXsmbu5aWUcLBPTHt2L3Enr+YToepIDBEUyzT+YPIQDSoYjuNB0al+BU5pwPYUwrP+sl0xBGKb8Hi38zvCCs X-Received: from jthoughton.c.googlers.com ([fda3:e722:ac3:cc00:14:4d90:c0a8:2a4f]) (user=jthoughton job=sendgmr) by 2002:a81:688a:0:b0:3b7:e501:90cf with SMTP id d132-20020a81688a000000b003b7e50190cfmr2167304ywc.501.1672913967234; Thu, 05 Jan 2023 02:19:27 -0800 (PST) Date: Thu, 5 Jan 2023 10:18:20 +0000 In-Reply-To: <20230105101844.1893104-1-jthoughton@google.com> Mime-Version: 1.0 References: <20230105101844.1893104-1-jthoughton@google.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog Message-ID: <20230105101844.1893104-23-jthoughton@google.com> Subject: [PATCH 22/46] mm: rmap: provide pte_order in page_vma_mapped_walk From: James Houghton <jthoughton@google.com> To: Mike Kravetz <mike.kravetz@oracle.com>, Muchun Song <songmuchun@bytedance.com>, Peter Xu <peterx@redhat.com> Cc: David Hildenbrand <david@redhat.com>, David Rientjes <rientjes@google.com>, Axel Rasmussen <axelrasmussen@google.com>, Mina Almasry <almasrymina@google.com>, "Zach O'Keefe" <zokeefe@google.com>, Manish Mishra <manish.mishra@nutanix.com>, Naoya Horiguchi <naoya.horiguchi@nec.com>, "Dr . David Alan Gilbert" <dgilbert@redhat.com>, "Matthew Wilcox (Oracle)" <willy@infradead.org>, Vlastimil Babka <vbabka@suse.cz>, Baolin Wang <baolin.wang@linux.alibaba.com>, Miaohe Lin <linmiaohe@huawei.com>, Yang Shi <shy828301@gmail.com>, Andrew Morton <akpm@linux-foundation.org>, linux-mm@kvack.org, linux-kernel@vger.kernel.org, James Houghton <jthoughton@google.com> Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 0AB05180005 X-Stat-Signature: zggbhakbtrz69nm3w698feauf7b1c1er X-Rspam-User: X-Rsp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EY0Ch7C/SwHkEuEmR/Ad49W1SWH1mNB+1OH9K7cfihrPtjZ2bI10fWDsKDSm7KwHYoT01ALhETAqIsMER04OxEHno68wq4r8BUqmnXJkKkvJP5IfBdiuk5JZwkQCyH6RoPfem8pfq4fPw0AJK6tIt8G4mjhE7gCxJiv4Ci+fZK1al05nzTH9avU9Hh5Knl4dyK3PjTATMqwIB56UDg5sKLCgKySdGerTMRH48hymAi8KWcS58t5x8AHU3VVZseL/oF1Cf6/KL3Md6kC3kjZ/X0Hi9dSx5sCtBqTH4dnIm+njZjdOJh3i8bXL2gekmec+oRzsibTacshwztcH+kI/OhDK5XzIo1yH0oqDnS+TBRxFPsk9BnczYISOEn3xF9PvAUVdm 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: <linux-mm.kvack.org> |
Series |
Based on latest mm-unstable (85b44c25cd1e).
|
expand
|
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index bd3504d11b15..e0557ede2951 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h @@ -378,6 +378,7 @@ struct page_vma_mapped_walk { pmd_t *pmd; pte_t *pte; spinlock_t *ptl; + unsigned int pte_order; unsigned int flags; }; diff --git a/mm/page_vma_mapped.c b/mm/page_vma_mapped.c index 4e448cfbc6ef..08295b122ad6 100644 --- a/mm/page_vma_mapped.c +++ b/mm/page_vma_mapped.c @@ -16,6 +16,7 @@ static inline bool not_found(struct page_vma_mapped_walk *pvmw) static bool map_pte(struct page_vma_mapped_walk *pvmw) { pvmw->pte = pte_offset_map(pvmw->pmd, pvmw->address); + pvmw->pte_order = 0; if (!(pvmw->flags & PVMW_SYNC)) { if (pvmw->flags & PVMW_MIGRATION) { if (!is_swap_pte(*pvmw->pte)) @@ -177,6 +178,7 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw) if (!pvmw->pte) return false; + pvmw->pte_order = huge_page_order(hstate); pvmw->ptl = huge_pte_lock(hstate, mm, pvmw->pte); if (!check_pte(pvmw)) return not_found(pvmw); @@ -272,6 +274,7 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw) } pte_unmap(pvmw->pte); pvmw->pte = NULL; + pvmw->pte_order = 0; goto restart; } pvmw->pte++;
page_vma_mapped_walk callers will need this information to know how HugeTLB pages are mapped. pte_order only applies if pte is not NULL. Signed-off-by: James Houghton <jthoughton@google.com> --- include/linux/rmap.h | 1 + mm/page_vma_mapped.c | 3 +++ 2 files changed, 4 insertions(+)