From patchwork Wed Oct 18 14:07:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 154894 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4818159vqb; Wed, 18 Oct 2023 07:09:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG5TccQZKLGrOibF5dgO4a8KOOnFwLto8GHdA7HtREKo/Zm198mq2+vDUcirdEVUf6iKX9p X-Received: by 2002:a05:6a20:9741:b0:163:ab09:196d with SMTP id hs1-20020a056a20974100b00163ab09196dmr4952047pzc.1.1697638193180; Wed, 18 Oct 2023 07:09:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697638193; cv=none; d=google.com; s=arc-20160816; b=AoSTQg9cRd2WMuYaHI1YpOi/dGwvJLWxCyiwewREO4JYKuW8o+7eVuWhvM6O4kf8CG dsjPLCmzqNtLf9hUhiC7qEHxP6SZXa2034WkqFnNa6LKmxP1vr0+yVSQl2yKngqq4oim 3YbTeZe19bKqHo+HUtoCStRjm2JKMiblfOhix4EVC6UY0jyRmrU63+3e05PpuncVQaGe qsA4sc/67Oz8Su8Sai+FVcmOmCl6lDrEqI3YTDYg/GWmg3WQCaj7nJ0kZUymVAgVI1Qg aA5wMQXx11Gb32taWqFlWYBfiHQBtvfYd3grJ8lYN+WrbTfl3QY1mrgWRErAF3XOErVO 7orw== 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; bh=DNlrD185RwWjuMxj0G5WMekXxP2MZsx6AcQ/7SuQlaE=; fh=Q+Hibf2y+6rOlBpt37Lm5i0wTMmcQsnxMBqJTtvbZCs=; b=YBKgfqBz9/BjHeIeE4EUOZqmeQFnCFILrCM/ue/FnBWmu0K4XLVz24eCXVC9WQBGo1 FLlbf4LB6q+mk9eVyx9zCeS/I3mxbW6XIlp/3mkwj5nfmKlXrH7iWQk2JTlkt/obmmdo 2+MQqy3YBYxY7hZYzreq4hXPp82G7+qr14/0QeK+doUYTVr2lc6x1DoXZGZB8HlqRZhA r8yjVQrbB5U3mG88IM+multqpaphwLV167Ly2MUd71+3eJj2aLDZvAk9WtixycENdVW+ X0v0XRwt0VilNy4FurnuXCfNcsgzX9T9nAGpQ309aNoGeRmFig6kkC5sFkRCZNy2x3xO +kUQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id co24-20020a17090afe9800b0027000086c93si1483001pjb.102.2023.10.18.07.09.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 07:09:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id CC90F817C892; Wed, 18 Oct 2023 07:09:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344898AbjJROJg (ORCPT + 23 others); Wed, 18 Oct 2023 10:09:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344861AbjJROJL (ORCPT ); Wed, 18 Oct 2023 10:09:11 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14AF3FA for ; Wed, 18 Oct 2023 07:09:09 -0700 (PDT) Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4S9XhH50l8z15NWq; Wed, 18 Oct 2023 22:06:23 +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:09:06 +0800 From: Kefeng Wang To: Andrew Morton CC: , , , , , Zi Yan , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Kefeng Wang Subject: [PATCH v3 12/19] mm: add folio_xchg_last_cpupid() Date: Wed, 18 Oct 2023 22:07:59 +0800 Message-ID: <20231018140806.2783514-13-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20231018140806.2783514-1-wangkefeng.wang@huawei.com> References: <20231018140806.2783514-1-wangkefeng.wang@huawei.com> 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-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 18 Oct 2023 07:09:49 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780102665955559077 X-GMAIL-MSGID: 1780102665955559077 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) /*