From patchwork Fri Oct 13 08:55:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13420536 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 E701BCDB47E for ; Fri, 13 Oct 2023 08:59:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A75308E0020; Fri, 13 Oct 2023 04:59:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 987EE8E0018; Fri, 13 Oct 2023 04:59:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 78DA18E0020; Fri, 13 Oct 2023 04:59:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 5E9468E0018 for ; Fri, 13 Oct 2023 04:59:13 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 2F13EB4B51 for ; Fri, 13 Oct 2023 08:59:13 +0000 (UTC) X-FDA: 81339838986.13.667B6AC Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf16.hostedemail.com (Postfix) with ESMTP id 08CE818000D for ; Fri, 13 Oct 2023 08:59:10 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=none; spf=pass (imf16.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1697187551; 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=pa08ZwhwHN71D2WtkqUifbiXbsdbM3dogAUlpCDT7lE=; b=XyaCOTQlPZ3wSdiTga9T9qxItrNkaLRIFa0FOJJ20N5daF21rN55TezYnb8dnfdhn3H1Rt xH4PY2yjVPyhOQINX1YkKTJbjBqUZimVx2WFbxzxR2JbwiirOZq0WBCbRfygfAfZHRwnOf dr1ST6bXhLlB4dZ+H8n4b/u8nO9xBHY= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697187551; a=rsa-sha256; cv=none; b=fyIV6W3wpr08DZcPr3UoKoO4hjKnqf8nsYAA9746yYuMC2BrkZTnqS6eb5yUlMzUgMy+1m 3QsDpqciMD0RMtfRbNrqOZvd+XZLryqsN+0Qilk+ZkHKiTWtlINB7AUXdRwV39A4959qF+ u1yYqXUBYI2HJh5rurCwRlUVo+cB2is= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=none; spf=pass (imf16.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4S6L0Y3b01z1kv1d; Fri, 13 Oct 2023 16:54:21 +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; Fri, 13 Oct 2023 16:58:20 +0800 From: Kefeng Wang To: Andrew Morton CC: , , , , , Zi Yan , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Kefeng Wang Subject: [PATCH -next v2 00/19] mm: convert page cpupid functions to folios Date: Fri, 13 Oct 2023 16:55:44 +0800 Message-ID: <20231013085603.1227349-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: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm100001.china.huawei.com (7.185.36.93) X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 08CE818000D X-Rspam-User: X-Stat-Signature: btxo1xpcybe3b9za4m681ykn5ztafmzn X-Rspamd-Server: rspam03 X-HE-Tag: 1697187550-545116 X-HE-Meta: U2FsdGVkX1+T5LzrhxxPjbQ8zXPG7exTVPi6uTCUb9nab+SOF0PJRKRRFq7444d92VsgwHW8/gF0xZC7rY7auywaOmHJoOEGwaK/eFAjDudDjRqZSiSe/qWcGch0V85SF5TbM6R6fSHv5CaQFDS9Dnp2SxWpqw1PDTyOmS38fLA8NYD2dMjQteYIM/IobVkICRh/MyRbLO1qWWt6aOAq4u4LHD/OXvBd/A/I5LED/yhMG6G/kYyICkyeNeZsi2g84baaa69Q01HM7xpChP1Wj/3+fTQrtND0zeNZ/g1isIcFOR5bSpwa8epdOaTwqgg9ZArALJsxrrbIYB/A+GzNF37Ih6LMhDKf4/prGRor3SAjfzTcBgfWa8Wcc27eYPdWjAtZJ/iKAJiGqy8+ywE6MaFQYSTar4O69AYgMHEF0F2+IhpROkZB+r8oB/roevxHefiuGySuhuiaAghpnZ2qObG70aFna2yywggecB3h7jSJuz/w8KN8U3LODDdsFWLPREYe2Kx9pyo0UUv+mNz+OTcli8zMvSK05chLA9rCEbShR9qBPlyI2Se+axy9qulAa+lBYaIMxht4Ngiyb3kScpCQHkJhbvYpdx8qmTJw6Z9b30QaTfcaWMqO5X1i9bvFOvPYu3vivHu/AvmMRQmDanYCD77ERME88DFyFK2jSwEncnh9mZSoN6+aJWyJMJ+EfIEmJDm2+3uVLDCuyUS+GHdP+SmVFU6s3hdZTM4hdzl0VD4QIsbaIyXh1Wwe58toAusFlwJkFyHiuW8LoFRIaLczJ69gBSmagQWhlAG4z2mKm2ggdLbuVMJ98UMb8sYaajXIX9E+YcsZW5If/qhPD7hyZCaqVV7ZMIz/fO3ooYEwwBxaba5AakfmVH2CwWwfrfpUWGGqobz3OsfgGOedns+FatOcjcWn724BbYW+T2LI6YUIAlLA8YIza5OQRvnwHEkU/+o2D9CZ+gSB1lZ gMCymO1n ustjQzx1fecohvlY2vj6u0AHcZQrGuHoWfe9sEZ0OLjumzIvUtD41blZqijODJ3BGnBgptCTnJNc8CBOu/MyQ+Vxb8FKidA0F0+P6AVoEZsvE+WN94OS6hcRoRTX4YAfU86rn 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() 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 | 37 +++++++++++++++++++------------------ mm/migrate.c | 8 ++++---- mm/mmzone.c | 6 +++--- mm/mprotect.c | 16 +++++++++------- 8 files changed, 79 insertions(+), 61 deletions(-)