Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2756926lqp; Mon, 25 Mar 2024 08:24:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWCeajCz70grs/WZ/C+u7nSwurpzGTiAOJWuxNvW22DieGXg0QmEkspRXQCPRGY+K2ldOyK3u8pAa/QFun4iGf+XAq/B3SPy+FPIc8bSw== X-Google-Smtp-Source: AGHT+IFqM9flqdXns2PeDPV+T6lgxesICc0W+GRl6bWQGBeFU+kXqdJixlQGR2aTWLOwTbJsdzYT X-Received: by 2002:a50:99c4:0:b0:56b:8cbb:3695 with SMTP id n4-20020a5099c4000000b0056b8cbb3695mr4976808edb.8.1711380269357; Mon, 25 Mar 2024 08:24:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711380269; cv=pass; d=google.com; s=arc-20160816; b=n6ARVj0UxDbYVq/62pm2wCgYWxo4mjZHCMDHKksRAxv5rFWAwBl3cV613YsXGMFiYo Hcb4kz+K2kqEmdnsRjl6dX5wPs7+zNVfsdIytPFwIZeO5F7SBJk+BMgcyrIU8YdjEcCh qgejIvNQfZ5jR0n1CMIJFUdm4PoA4JNiZ8SiHoZrrVdf59BOo9yVusInV49kZ7EFDbm4 TatLdoqvBst/M/IusMIHwetta4wyD+UgSOMPARKAm6tl9KQiboSCC2S+cUP2G4mt88ze 3/7Oe9ZUhSxW4G+MmAxKfGml33XIraDCzCOIqMhd/nrJFCXNnSmZ4u9KaQuACByi0Xp3 AUHA== 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=82Tkto9wLAThGWFPjMOHQAMNM/SHGFFIudThbRSmfJc=; b=jsxxE4X5moJa9OJOlm60RiHgZ2+5jRD0VxcAGKgI54O8t7/BNGW2lb5Pfap8ZgavlR lxf/9/6lukToC2gnQWuA/AxAKmue7lYYSH5KWNYnI9ZD2iwt53r4U49uP7/Uuoo5xqNa xO4Ij7Ee+oCBi1XrtaYynMNKMuec+YD0RmH8PytZjN9z0Q9rY9xAgzt6mGD+oB/i8E/g ELhQMZGq+DUIZTUQ+Ztr/i4DevjfsfdG8TcRKEZJZ9WsuCz5PjDlEc6zs+iF7kz7+A4t 3LnDgdtRTnYTkb2os5VkhBr0ylppMn7OGqPHTjguLEWP3oMrBIj2PcxX0Q8DA7wjTmC3 iVUA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Whi5pHJZ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-117036-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117036-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id x8-20020a056402414800b0056890b222e4si2594034eda.178.2024.03.25.08.24.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 08:24:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-117036-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Whi5pHJZ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-117036-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117036-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 170CE1F2E8AE for ; Mon, 25 Mar 2024 15:24:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8995315DBA3; Mon, 25 Mar 2024 12:45:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Whi5pHJZ" 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 B65106EB69 for ; Mon, 25 Mar 2024 12:45:53 +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=1711370753; cv=none; b=Z0eBFUtJoQgnWfqM122FEH2cAO1ybpd66VDXT3BMhbmvri79O4rp9FSIKkx7K2ZGLq42jUdvQHqpOFtsxDuYZ8AVpZ63A5m9LBltfsm8oH/0IgIRIg10W+t08KKZ59MxoZ7ptCs6rX0SRGVwdTEkaQyQYy6SpcYwS3shYOymFek= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711370753; c=relaxed/simple; bh=JrD4352jMaYHyAz8IW4Sk3DaQV9z/B+p1XK/ErSE0cs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IfJ9BmGrgLM6upAPtnjY9kstxgo6nS6XpECeTEb01Q4uInGFZYM8/VCtnYDgm/NZd58vQR/CeasAWR9fDupURoDqFf9dB3qmCc6wgEBsaQLzUOT8deIN8QNP7IxlFVcTl6P0Xo8B20pUO8z+Hrhihl8fDeS2C0YFO5Td1zY5Sbo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Whi5pHJZ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05091C433C7; Mon, 25 Mar 2024 12:45:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711370753; bh=JrD4352jMaYHyAz8IW4Sk3DaQV9z/B+p1XK/ErSE0cs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Whi5pHJZTUlUd6zeuH0lUbmTWwy8sj968vK2RQbExjSv4J927iQXRAax2+zqP3+8Z syH0Miydew3n+dIqfFQbEdodShg6okCztcVT1q/0589fuGXcfUyzduK6ZLpruSDHQG 3ZJJAaqW+jGIx0FmJUNVsuUy8O+V183kQWq9ZI5P+NnBZUHq4iLWx8Si409N3S33xo uUtJvUSWMGqZ0Dn4M3kn9lOThpHWghQ3aPLhvV11Zk1dkPmeiEWNNzvj1Zp9e2UbXj ga9Fu+iazyMERJXJ+ZWG4V/8cwEH/THIP5vbAm67Aj1t2p2C3InwRy3kCtGkNu6HGD i24BIgprJ7qvw== 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, ryncsn@gmail.com Cc: "Alex Shi (tencent)" , Hugh Dickins , Chris Wright Subject: [PATCH v3 03/14] mm/ksm: add folio_set_stable_node Date: Mon, 25 Mar 2024 20:48:50 +0800 Message-ID: <20240325124904.398913-4-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240325124904.398913-1-alexs@kernel.org> References: <20240325124904.398913-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