Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp978749lqp; Fri, 22 Mar 2024 01:35:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXVpbiEo9GpogLWLEPuNZM2bcjpdvMGX6Ga2McZvjOVwbcGuapKQUI14VCJkx5FjBojO89mOQ6tSaR7CKScydM9c2MnfvBcCQOCe+pkyw== X-Google-Smtp-Source: AGHT+IHAY5xcxJ2j9NXukcyeoaMdtHETa2poNNvNsAm5CNGwlFe9OSlMhagdA0l3r7ydpr/4kqRl X-Received: by 2002:a81:77d6:0:b0:60a:5a6e:697e with SMTP id s205-20020a8177d6000000b0060a5a6e697emr1720579ywc.35.1711096519425; Fri, 22 Mar 2024 01:35:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711096519; cv=pass; d=google.com; s=arc-20160816; b=Vr7hhJkztBMhBrQCyDj8lT5s9pyfkAIHxVG3vjqbADEC3b/iKir5gZ2wUY94i40s9x 4zQaCGvRUSHuRKenKzlvAkR6/YJe7f762z86WNmq3l83jrwUfV0z/AhEh9nImWoOsjQG jtdF93IRejbpwcXjFtJe2EUqrPQMLj64jO8hq0LLpWsHwAX/ovph9mEdmhx7enKyqqJ5 3QN/DAXwCP+ChnWeGh4X0BDUMxvfRk4r7YPUyKmM8E1ZRqFkgDvLGKk+GBS/ftqbYZVa emjW2L3Z2ouB/KS0n+aGUMp6NzO85JQZbsGOGHWonyNhaXeFztnXSWYqLP25iCzGLDq2 uKXA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=XGMdmYS1oT7AtfIwzwhYVurhrnfmW9Hkdz0PxTq4TG8=; fh=CTFdFrbtP7Z7TCdMbqsgkrQi425Yz+qx6YS+cHHF8Sc=; b=03ZGpwc+XAKLLDiniMapHtbiO5Rxl/SEbRsF5mdH35DmikH0IlBl7+FDnKO9DzA367 fB/O6GgOmTJ1Wp72pBaqMx/t39fHeqlIgSVDY3mq9EFd1RANeyPpMzAeLuX1i/j11blJ jXC0PRHyS5y5wmPqmY9Ah0S3f0w95G6RoR4BC1nHwnhdak0l1W9GrenUzJ7CBYfkS/2L 5jsPbVehU7HZQODBpDErr2MTQ/b52qODiebMeEqDzdgpBVxUBFjXBqhkG7m5Qw4Hfs82 Y+/1bZAHBe3eHEcjQUK4Mepk1Va7/VvTNpJ1XRHrINLhEWPKkm1oE+walB8PHLAj2Em7 IPvw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oZsUV3DT; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-111132-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111132-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id q20-20020aa79834000000b006e70c4de7e5si1441476pfl.152.2024.03.22.01.35.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 01:35:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-111132-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oZsUV3DT; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-111132-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111132-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 0D1F7283100 for ; Fri, 22 Mar 2024 08:35:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 16EED2233B; Fri, 22 Mar 2024 08:34:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oZsUV3DT" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F7C9210E9 for ; Fri, 22 Mar 2024 08:34:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711096480; cv=none; b=jXb2HuPt1lfQGRcN3yalseA7iW/3RYp8yxxDBw5UoDXcOb5zca9z79h263AhDvWM3FOnioew2gLg6lY6KN7ITgHO5LzzGBfixhskBYidDz4atJ1gmk2Wbt9MLXiZT7pnM3r4Na68DgYbWUmJYlyUtiDxVyZD0Iaw6B3lRO6bdcY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711096480; c=relaxed/simple; bh=JrD4352jMaYHyAz8IW4Sk3DaQV9z/B+p1XK/ErSE0cs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BxfIdZrsTbbJFVpFIb1gU9rH0vfHbhTlZI8DLJDvXuY71jynt2QJdD4moMNO+jmMMbLscxSGr+jRlUFTtngGTvmbNTZ0grI/RQhsqrIHPTTWTzj6r07/gekPgY8r23gxyn29xfQF5MX+STkqc3yF7zTNK4aOf3i9hZW7lhcfkVE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oZsUV3DT; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6D24C433C7; Fri, 22 Mar 2024 08:34:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711096480; bh=JrD4352jMaYHyAz8IW4Sk3DaQV9z/B+p1XK/ErSE0cs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oZsUV3DTdJGLOu3ArzMd4oBovBPkSTl3ExBe2TyrGm2/jsGBl0k10Tvb00FSPq3S6 HrYImJ0RI3HDEKE7ufsczVtoViNfJEwZN9YIkae2ZLk6e3LzCTFevFL5JDTvjrfEi2 1Krww+MAEQwxg1AHgGsJp/Ixwx4wJqSIL3gSdw6vxRe5OKsZC9Q1IKRshBGsMmOMOI CEvi84IPNAKHdOC78TlZvwbMIAMRx/CYz+BIm3cTd59Td9FnlatulZGWWUAh0h/2Zo QrPXJLuUfcwuY1AVKIhMNeokjf9qdt96JM8SbuxOL/2KIkf6uHch3y3hWX9UK8wv3P OYqn8jLHP5OCQ== From: alexs@kernel.org To: Matthew Wilcox , Andrea Arcangeli , Izik Eidus , david@redhat.com, Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: "Alex Shi (tencent)" , Hugh Dickins , Chris Wright Subject: [PATCH v2 03/14] mm/ksm: add folio_set_stable_node Date: Fri, 22 Mar 2024 16:36:50 +0800 Message-ID: <20240322083703.232364-4-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240322083703.232364-1-alexs@kernel.org> References: <20240322083703.232364-1-alexs@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Alex Shi (tencent)" Turn set_page_stable_node() into a wrapper folio_set_stable_node, and then use it to replace the former. we will merge them together after all place converted to folio. Signed-off-by: Alex Shi (tencent) Cc: Izik Eidus Cc: Matthew Wilcox Cc: Andrea Arcangeli Cc: Hugh Dickins Cc: Chris Wright --- mm/ksm.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mm/ksm.c b/mm/ksm.c index ea3dabf71e47..c9b7c5701f22 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -1109,6 +1109,12 @@ static inline void set_page_stable_node(struct page *page, page->mapping = (void *)((unsigned long)stable_node | PAGE_MAPPING_KSM); } +static inline void folio_set_stable_node(struct folio *folio, + struct ksm_stable_node *stable_node) +{ + set_page_stable_node(&folio->page, stable_node); +} + #ifdef CONFIG_SYSFS /* * Only called through the sysfs control interface: @@ -3241,7 +3247,7 @@ void folio_migrate_ksm(struct folio *newfolio, struct folio *folio) * has gone stale (or that folio_test_swapcache has been cleared). */ smp_wmb(); - set_page_stable_node(&folio->page, NULL); + folio_set_stable_node(folio, NULL); } } #endif /* CONFIG_MIGRATION */ -- 2.43.0