From patchwork Fri Oct 13 08:55:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13420532 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 6FE56C41513 for ; Fri, 13 Oct 2023 08:59:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3BE078E001C; Fri, 13 Oct 2023 04:58:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 31F288E0018; Fri, 13 Oct 2023 04:58:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0FCA78E001C; Fri, 13 Oct 2023 04:58:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id E8A2A8E0018 for ; Fri, 13 Oct 2023 04:58:50 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id C5DDE1601D8 for ; Fri, 13 Oct 2023 08:58:50 +0000 (UTC) X-FDA: 81339838020.30.2F70762 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf16.hostedemail.com (Postfix) with ESMTP id 26AB2180008 for ; Fri, 13 Oct 2023 08:58:47 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=none; spf=pass (imf16.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697187529; a=rsa-sha256; cv=none; b=yw3AzjrhFp3qULejMHN8S3YPjPnmHGtqDYpkAmnUL+N3LjJoSqrcxJY4NmAEXaBwsZfxMJ oICq1+z9WQHDyVeEuEyOHUtFT+EEUhN/ZMXzU7cgO68bc6xuE6Oe056bn8e9nEdEUVftQG cSgG3ab14sxMGFouSGtj9/A/sEkTdTY= 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.188 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=1697187529; 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:in-reply-to:references:references; bh=DNlrD185RwWjuMxj0G5WMekXxP2MZsx6AcQ/7SuQlaE=; b=u5SylyRqKWOQECNOT53xCNS8cPWlg2i6T2GkuwWiLPmPkfSfDaOhzORlqbgalmZbVxyYdK cQt0Lx2JrcKqKFzrTZzHmllqZEhufjKVxcR+/L/X1LheHEfa8dhspgpfwux7zvWYbc6Qyy UlxX7+pJiFdwEzxUu60vrbh7Dnt+L90= Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4S6L0l1jcqzLqXJ; Fri, 13 Oct 2023 16:54:31 +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:27 +0800 From: Kefeng Wang To: Andrew Morton CC: , , , , , Zi Yan , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Kefeng Wang Subject: [PATCH -next v2 12/19] mm: add folio_xchg_last_cpupid() Date: Fri, 13 Oct 2023 16:55:56 +0800 Message-ID: <20231013085603.1227349-13-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20231013085603.1227349-1-wangkefeng.wang@huawei.com> References: <20231013085603.1227349-1-wangkefeng.wang@huawei.com> 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-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 26AB2180008 X-Stat-Signature: g6qkt7fw58eskkhkc48rid8e4jdxhchp X-HE-Tag: 1697187527-460834 X-HE-Meta: U2FsdGVkX1/YWAy7IQ6L9TvwOiUcWlAgT9tWopa5iQA1l7BK+0mMowwP5iXvCuVEARPw+5yrKzzEELSYpfNEVaSpqdsVsccMfGOyBkpmpnNqJs4s30I3ECsdey6YOLzb2wXWLRQrjwQMD64X+GDHj0Ec27mqeqj1oJKkA361NIwnWtYWnS15dZ8JdBIX1M8xV4YfqAap/+dfu9awrZy2L6bQY+q0kU63dV5UAZtC5LsxtVqSjak7IxaJyaJOpUjQ9YcbxTKRNiJrtKK6OC/Fqb0YZ4/OY7lELBXCRSz1FBHm+0wq5m+WKbq/HGk1h+Z3HY/idzTBaaOS1r4l2zd/IV0IuQ++ef5UbUp8UjgepsL/C+hgStulVQ6z14hDKave2UvN9JWoZ61HTyOiKGVaFoD90H+PkuV/Ssq0EzxaUu+Arl4zv8F2FzAj2rPPrr7LETK++ql9dUVALxgvltjB76LWBq6AiDQ/UZgK03IZVOOAn1nk1J9udhYMOPhjJCuM8QV7aRHs06rifjHfZuuWUVtfXQ+XycqavG4HhcrrtZShnw8Yj2O7HD6hvzgm7X67BvhUSsbcwM9X/Yg7DCa0Os6Rb3UC54iLXVy6QRts0aB0gD2Xu4QriGmhKyeUMqH+5t92zHSW8RHU7WbxRmbzsQmMHbL1TiN1JRIOEsQ/OEg+0M+a7vnWLIqYpKi6P8LgDIO53PGjdUW+0tW+MKbdd9IdY63nedRVPeHanf/ymKSA/AW+eF/MImxvMMR6CiXAxdP7rFAZIKkWr/JZYMfiVHsrtSeiAPuJZWE/J6T62ccCbh/RgF7SEWO+5FzE9Znu/JTn6ys1xNlA9P8gwdMUYQWyO44fUSv5XZ3eA+KemOdns9spAjh9UE8nORwuYzFQuePCcDn1ZEW8azihmTE4/wFYoGE0xe4FM3/HA4uxOMgnX3E7fE8Eqo79h8xppbnegu35EhA4xwfGimQWf9j 5h6GEeyZ KgvIGHZfmkozAR93MXub4Fjtx32Cb0qKDiYIHvhr3h9i7dmcNd4iD2cZJ/gVtg8OOKJa9eiytoYADYAm8oyIwNxjut4MknUU2roEgCDtKQJ450dQtcnBvJa2SHXfRXHlO3SzDkOOaY6ZDthdr9PXASwZE9Wt3cgpp0Qv1yD6W9yyo4Ht9qVSi5NDZfCx/2lZzPOvZ4jNcxTAz+7+FGbzwloAX4QybmBShdiym 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: Add folio_xchg_last_cpupid() wrapper, which is required to convert page_cpupid_xchg_last() to folio vertion later in the series. Signed-off-by: Kefeng Wang --- include/linux/mm.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index 8a2ff345338b..8229137e093b 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1795,6 +1795,11 @@ static inline void vma_set_access_pid_bit(struct vm_area_struct *vma) } #endif /* CONFIG_NUMA_BALANCING */ +static inline int folio_xchg_last_cpupid(struct folio *folio, int cpupid) +{ + return page_cpupid_xchg_last(&folio->page, cpupid); +} + #if defined(CONFIG_KASAN_SW_TAGS) || defined(CONFIG_KASAN_HW_TAGS) /*