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: 152419 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp1751887vqb; Fri, 13 Oct 2023 01:59:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHFcZQJ+vqly3/dYgTwuyUj7QiIrNGajxqA4+GDs9rMC4NwSnxPKkOHKv0fst84c2MJXlSU X-Received: by 2002:a05:6358:e908:b0:147:47f2:2d54 with SMTP id gk8-20020a056358e90800b0014747f22d54mr22870276rwb.0.1697187580893; Fri, 13 Oct 2023 01:59:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697187580; cv=none; d=google.com; s=arc-20160816; b=0BUi0uhIANp/D2bxCdlaEPOrUkBTLZkm5KSf5HjtR76o1zZDFqkwFvGEswl2rA2i3u z3fdT75lCYic3NFjfNDvKTjUZgUPR0T8VBFwFjBdduB9ipq0u/C0zbrTsz+aihFbxxIW OfO7jV2KFxSwS9Gy0KCeoA+44UpPyR9HvvmP7CzsK5VI4brQ6kVNF+55Ohke5dRPmIRV cEWkYAbeZ0jY3V6lq6IlR8hx6RO27o+/UIwYR/UXfbq++FsAQq7fQWPfHQqw2XRHLtKk M3r3KlrTlU/bgaJE7lHJfIG1fETTXNR/8yk/9GnflRVSmFwZBbsah44RQLSMSQa7axoq soKg== 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=YAgVFDk9fV7yW8vOAa0AvFuJNUfx51ismDa6C0byRV6oUjXf3OI3jWJd4fRlegeuEU LGYSVYelz1cwJUucl5SrUD4iennfIWrKlT6zqWEw8jaXmkj0zknuOD/Z7el01SjvNhZu V6gEJRgQQMPiGgE4bSVZoxji4LDUxqSoqwtw08TanElpn2kz5CMN0UGCaoMmZmdHBkuF yK/ArXpjCPdp6i36p+BdAYyTOzQKGfLzA0mXTem+EFAN+EqzKPJOWtNK3tGeuw0nWaYb +UMOqKlZH+S7JOJ/aLFtLw4dxfQvXo/yhQ3x1UbMT00qLu0kwqsNGcVVsRMYwwKIx8T8 T+0A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id u190-20020a6385c7000000b005ace065e52dsi397898pgd.369.2023.10.13.01.59.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 01:59:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 7CA4681B5D0F; Fri, 13 Oct 2023 01:59:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231367AbjJMI7B (ORCPT + 19 others); Fri, 13 Oct 2023 04:59:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230333AbjJMI6b (ORCPT ); Fri, 13 Oct 2023 04:58:31 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC8C0C0 for ; Fri, 13 Oct 2023 01:58:29 -0700 (PDT) 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-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 agentk.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 (agentk.vger.email [0.0.0.0]); Fri, 13 Oct 2023 01:59:35 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779630164571313063 X-GMAIL-MSGID: 1779630164571313063 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) /*