From patchwork Fri Oct 13 08:55:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 152425 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp1753072vqb; Fri, 13 Oct 2023 02:01:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGT6gwnpYUUgijUgyzl2N11plPdmkqGbTmLS7Z8RXfAlZomne2mvG2uo4flcosAfySC43SP X-Received: by 2002:a05:6830:4902:b0:6b9:b987:1337 with SMTP id eq2-20020a056830490200b006b9b9871337mr31325156otb.1.1697187709066; Fri, 13 Oct 2023 02:01:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697187709; cv=none; d=google.com; s=arc-20160816; b=tiS4fZgBuRF0Uk5yCL8I08FzWAb3+RDUiXxT/E5J6BP/1t4AXdPqPejKbjowJhbl1X dSvTAo4+TgvuFFAR9kuptPHzFuH9XmyyyWYi1BtpDe7z/ni4g+UJBoiE+aoYcI+aKBy+ +fzH79AOi7Sq48V79RAzAJcfURIeC4/iBzAK3/LuZw3fCbxXa8/l6O6TOEGXnjBNip0F PciBvRD/7yHwI6e2Vp7sLnRnndTBp0pLAszC0UpQG/farMtzN+2VEn1Z/A2FNkv2ljNU 64PEbDxwWs8XWtXWlMvvdTeYP0N2LGnJDrq+LvOr53COrp27h7XRqkh9BktJtnSAJLp7 Vg0g== 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=ONiFhuoJXZyIBus5P7d1IKd0msDLCi+tp53vVhwi8Pw=; fh=Q+Hibf2y+6rOlBpt37Lm5i0wTMmcQsnxMBqJTtvbZCs=; b=xyISXhOZdshV9CYdAzWXM331T9d4DfVO6F4iigk1CWjQt01T9sUD7GM2TdHNiGlu2c CJM9pS4QZTXi+LI9SXaB2ZJhRcw0URxkknW9qfgLdDIFbm1ixTViubfrMERFxRrohynd ZvrM7hV9Bkv0FpWGAmSqjvwVEcASql8POt1St1nndvNSirybv1I3iLdE+6EHapkkJ6zq aIHkDMIPrb4qhMQAxcSoCJtp+14rb+Z6vuJ+Z2yVMyu6HlFJ1SUotoVCJvpWUL9yPyjB wf4S84lBVuqHCB6n11kkoZUAKi2LkkunThF754U5o5nh4XVuUC0vyM9Fh6K5kLGx93p6 9S2g== 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 g21-20020a056a001a1500b006b1fb740866si1353452pfv.189.2023.10.13.02.01.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 02:01:49 -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 7458982CC46F; Fri, 13 Oct 2023 02:00:05 -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 S230368AbjJMI7O (ORCPT + 19 others); Fri, 13 Oct 2023 04:59:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230357AbjJMI6d (ORCPT ); Fri, 13 Oct 2023 04:58:33 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0438AD8 for ; Fri, 13 Oct 2023 01:58:31 -0700 (PDT) Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4S6L2J4jVLzrTR9; Fri, 13 Oct 2023 16:55:52 +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:28 +0800 From: Kefeng Wang To: Andrew Morton CC: , , , , , Zi Yan , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Kefeng Wang Subject: [PATCH -next v2 14/19] mm: migrate: use folio_xchg_last_cpupid() in folio_migrate_flags() Date: Fri, 13 Oct 2023 16:55:58 +0800 Message-ID: <20231013085603.1227349-15-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 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]); Fri, 13 Oct 2023 02:00:06 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779630299251538076 X-GMAIL-MSGID: 1779630299251538076 Convert to use folio_xchg_last_cpupid() in folio_migrate_flags(), also directly use folio_nid() instead of page_to_nid(&folio->page). Signed-off-by: Kefeng Wang --- mm/migrate.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index 5348827bd958..821c42d61ed0 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -588,20 +588,20 @@ void folio_migrate_flags(struct folio *newfolio, struct folio *folio) * Copy NUMA information to the new page, to prevent over-eager * future migrations of this same page. */ - cpupid = page_cpupid_xchg_last(&folio->page, -1); + cpupid = folio_xchg_last_cpupid(folio, -1); /* * For memory tiering mode, when migrate between slow and fast * memory node, reset cpupid, because that is used to record * page access time in slow memory node. */ if (sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING) { - bool f_toptier = node_is_toptier(page_to_nid(&folio->page)); - bool t_toptier = node_is_toptier(page_to_nid(&newfolio->page)); + bool f_toptier = node_is_toptier(folio_nid(folio)); + bool t_toptier = node_is_toptier(folio_nid(newfolio)); if (f_toptier != t_toptier) cpupid = -1; } - page_cpupid_xchg_last(&newfolio->page, cpupid); + folio_xchg_last_cpupid(newfolio, cpupid); folio_migrate_ksm(newfolio, folio); /*