From patchwork Wed Oct 18 14:07:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13427124 Return-Path: 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 637A7C46CA1 for ; Wed, 18 Oct 2023 14:09:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CB57A6B01A0; Wed, 18 Oct 2023 10:09:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C66706B01A2; Wed, 18 Oct 2023 10:09:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B553D6B01A4; Wed, 18 Oct 2023 10:09:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id A64226B01A0 for ; Wed, 18 Oct 2023 10:09:07 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 6EE62802F7 for ; Wed, 18 Oct 2023 14:09:07 +0000 (UTC) X-FDA: 81358763934.20.4A435CD Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf04.hostedemail.com (Postfix) with ESMTP id E3BD640026 for ; Wed, 18 Oct 2023 14:09:04 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf04.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1697638145; 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:content-transfer-encoding:in-reply-to: references; bh=k7pqMFp7eOMdjWpB2AgxfOcVOmx6eC3nibJvH4YFzYI=; b=EZ0wZqUPoTBk3/oyIAlC2Z9RMDXgjh+/b/BT4MY0AH0Xcqt/Om2Klk93Hia7RnwIPYzqxh nZz3cUffdJCfGlmARuMC6gRZNGF90dlCahIvkjWLStTSLZ7uECYiyC6msqLEAIHRg/SdHf wODSrLnhzCa/v+Lx10aRBT/ZwDCr/EU= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf04.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697638145; a=rsa-sha256; cv=none; b=WWMHTXyLlPL6NFaks+367M6aIW22wogyO80YR+bkgTW3IQBWyDAu7D40DqbevNb6LJ7afH 9vdx+YG7KG52Vf3PGi3+tgAvmN+fAaThJcZrwTXWpf0fsauyBXtfTdKcNxlR1Oek0SyM9n PLAoLeoC7kqiULwPfOI8h0at2oHENPQ= Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4S9Xfg652yzCrR7; Wed, 18 Oct 2023 22:04:59 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by dggpemm100001.china.huawei.com (7.185.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Wed, 18 Oct 2023 22:08:58 +0800 From: Kefeng Wang To: Andrew Morton CC: , , , , , Zi Yan , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Kefeng Wang Subject: [PATCH -next v3 00/19] mm: convert page cpupid functions to folios Date: Wed, 18 Oct 2023 22:07:47 +0800 Message-ID: <20231018140806.2783514-1-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm100001.china.huawei.com (7.185.36.93) X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: E3BD640026 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: yq64e7ar8d3ponuqwybhenhcjp9mrgx5 X-HE-Tag: 1697638144-959666 X-HE-Meta: U2FsdGVkX1/+E27g2a/lGT839/E0NwHfptcGL/S0EdK5lw5T32lzcCn7yEiXKi+6f5s1rNek3wJEfUkBqiHEouWwbogv/QoLv319yN3Vfepa3dtB7jwAdAJ4+jtn/50ifD80GIaAkDi4gfY9+uGkw95QWToDh7Sl70YjVvdY+brBIxot6SouP1lm+NZgb9Y0DkZ7z5R/GwYTNbK4n9FiVNjsCTAH05wCHLEzQavbAMleVoT2dnP3sV9PJwkPjX5LPCUHJk7z2dbBGMVq+AdvC9/BLeW0ZNM8kuVef4xrrMXWDB8E0dco2zUhhwX/YngK8pHbtwyidyyE5uoy/XfdtsyyvCm6XFvdfWdul9mb38/2InBsPiN/Ac/2/lLHpi6HuvJnP7txuWUXFY8yoz7qYg0jmHHPdU8JzvYe4y1Y6T+9gDiDTmTPPDc81F//vGcX6U/E0byIwl0/kCUIqGyE8Vdo+g7l+NW+zXyv4wwyWH+HSXa3hJ9KUOeIN3b1aAH2e1dCNY7jOqYBURAqSe1OQCpaBPWVCVyFIKEGCaCM0G2PNBIG8BowuCk+HoptmNjwda/C8hdk8/+XYaivfsW3y0/3X6IwabO7r3VImNGHfofhlz+9eVP9HU2+fy/GkF01yoJ90IhOdwJN3rG/nK/gq9g/yg2NBBReTBpuFAk+5aMuTqplnAlnG3iiCNNOjoQkyHsI3/XSwbdWQbvXjJY4lsTiSdEEU5JbJGJbqN1D4EXjl2c62nif4xTsOyTmksSpEkw1hPK/k08opCQB8Zmy2TJ218r1PzXaGVdpWTLxzNp3anh2EwGSx6nSWhC/WAo0SfEzxF0wroiMlz/Mxs4IZ0cGpLr0HHihbKZu87J0NvUNnvxYQZobB6w1VrJW7UXb0Wui54NhgKCnslrAj9mXi4sC6bLYGQ40/+BtsPDl3qG6hMEre1oL2IeKAHtGA2OmTYfqjpwjyREt5Dd1Bk/ cCsAAZna vKul6qbnFJ9coQqZipHEi/cosIO2oRRQtoVUFK4hCLrhXYxD4PreK/09D2VbTQeTE49IZ2tRKjENfZewfVUWdbCN/R4Zv09zuRccjixiGaDaw95H6igkwRp5Xmw== 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: The cpupid(or access time) used by numa balancing is stored in flags or _last_cpupid(if LAST_CPUPID_NOT_IN_PAGE_FLAGS) of page, this is to convert page cpupid to folio cpupid, a new _last_cpupid is added into folio, which make us to use folio->_last_cpupid directly, and the page cpupid functions are converted to folio ones. page_cpupid_last() -> folio_last_cpupid() xchg_page_access_time() -> folio_xchg_access_time() page_cpupid_xchg_last() -> folio_xchg_last_cpupid() v3: - fix finish_mkwrite_fault built warning reported-by lkp - address the wp_page_reuse() comment of Matthew, also update changelog of change_pte_range() and wp_page_reuse() a bit - rebased on next-20231018 v2: - add virtual into folio too - re-write and split patches to make them easier to review - rename to folio_last_cpupid/folio_xchg_last_cpupid/folio_xchg_access_time - rebased on next-20231013 v1: - drop inappropriate page_cpupid_reset_last conversion from RFC - rebased on next-20231009 Kefeng Wang (19): mm_types: add virtual and _last_cpupid into struct folio mm: add folio_last_cpupid() mm: memory: use folio_last_cpupid() in do_numa_page() mm: huge_memory: use folio_last_cpupid() in do_huge_pmd_numa_page() mm: huge_memory: use folio_last_cpupid() in __split_huge_page_tail() mm: remove page_cpupid_last() mm: add folio_xchg_access_time() sched/fair: use folio_xchg_access_time() in numa_hint_fault_latency() mm: mprotect: use a folio in change_pte_range() mm: huge_memory: use a folio in change_huge_pmd() mm: remove xchg_page_access_time() mm: add folio_xchg_last_cpupid() sched/fair: use folio_xchg_last_cpupid() in should_numa_migrate_memory() mm: migrate: use folio_xchg_last_cpupid() in folio_migrate_flags() mm: huge_memory: use folio_xchg_last_cpupid() in __split_huge_page_tail() mm: make finish_mkwrite_fault() static mm: convert wp_page_reuse() and finish_mkwrite_fault() to take a folio mm: use folio_xchg_last_cpupid() in wp_page_reuse() mm: remove page_cpupid_xchg_last() include/linux/mm.h | 30 +++++++++++++++--------------- include/linux/mm_types.h | 22 ++++++++++++++++++---- kernel/sched/fair.c | 4 ++-- mm/huge_memory.c | 17 +++++++++-------- mm/memory.c | 38 ++++++++++++++++++++------------------ mm/migrate.c | 8 ++++---- mm/mmzone.c | 6 +++--- mm/mprotect.c | 16 +++++++++------- 8 files changed, 80 insertions(+), 61 deletions(-)