From patchwork Fri Mar 22 08:37:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: alexs@kernel.org X-Patchwork-Id: 13599740 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BA51C47DD9 for ; Fri, 22 Mar 2024 08:35:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AAD4D6B00A7; Fri, 22 Mar 2024 04:35:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9BE836B00A8; Fri, 22 Mar 2024 04:35:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 810F16B00AA; Fri, 22 Mar 2024 04:35:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 5925C6B00A8 for ; Fri, 22 Mar 2024 04:35:13 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 3045380568 for ; Fri, 22 Mar 2024 08:35:13 +0000 (UTC) X-FDA: 81924015306.24.9C14958 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf13.hostedemail.com (Postfix) with ESMTP id 6A21320026 for ; Fri, 22 Mar 2024 08:35:10 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=iAcwg2U9; spf=pass (imf13.hostedemail.com: domain of alexs@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=alexs@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711096510; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=TfVtUpv+bViU5SEY+5vl7RzuFH++KFzflA9vTjEeuyc=; b=k9DmXlNRXarnHLU7T3zxO1vUmMl/bFcvLvIQJkfuZba98PF7YKk57b7VPoC7lTx69DVkDE 5bXjZ5ZP4ta69wsEVxmzeEeksxoNfQ2/EajV2mzBWhhLbDvGpCV9B9lEPp2EUfALGZwg94 ivLdhSLk4n/47xc6tfenxD3bNWwRxDw= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=iAcwg2U9; spf=pass (imf13.hostedemail.com: domain of alexs@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=alexs@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711096510; a=rsa-sha256; cv=none; b=hy0bng71z977xfnhaHF9pH1uLW3GzrCC3nISbNtUZIwAHR6Qlf7erLqIzR2cU7ar85/G8Q YdrwqXrhE726TU8exKhb9NPuUpNEWI2aVcdkjf5PxJC9XtkzBFXO1jc8UNRuv2c+S+G0o2 9NMOg4ZZSd44lX40AvYbVOq0uu8eENM= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id ACDB26143A; Fri, 22 Mar 2024 08:35:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 484F1C43399; Fri, 22 Mar 2024 08:35:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711096509; bh=ZriKAGE58KVGgk3LtHqsYBhdOJzv7LI/X6J606D1xxw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iAcwg2U9TA5i2WgtDkxRMvKzkar2T0ss4NV9QTixbCGq/vdCNstF1KB7VAtunrssD roMaD4WVS54iqRVPCPq+8eu/D56fmO+XQtn/NRSeXhJuc2PfZCkA/BLwhnS5EZdZy7 y1acuH42/rzI5sikMvS+UcpS+RP522841XB3DOjkzB+uGxSBmrjUq+InQ67lNY75c2 v2AOGRLtDpSo45fcsKX+d5T7ViAUoXym1Jh4dNGUDI51D7Y9GcF3fNZvf/bPUPFI5K sS9y+mlzPqzI3051GE6T8aiyK68i5He/zcTKNaQfSGI9ORdzAnckSHwGeYYok2i8Fr X08VhSxlTW+Sg== 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 13/14] mm/ksm: use folio_set_stable_node in try_to_merge_one_page Date: Fri, 22 Mar 2024 16:37:00 +0800 Message-ID: <20240322083703.232364-14-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> MIME-Version: 1.0 X-Rspamd-Queue-Id: 6A21320026 X-Rspam-User: X-Stat-Signature: 1ot6s7866zqfeqtr17zpbotki3uub3jg X-Rspamd-Server: rspam01 X-HE-Tag: 1711096510-268265 X-HE-Meta: U2FsdGVkX1+3zWTRAlJ72NqLPsEpoDvbWZzYwKE82AgtPf2/RA328Qi/jNUxIR5Q5AEbGsp+M2QLd9fuQGyzDignxS0A3iBiDzzFibdxhvOqUrABTKkK7k18qSQjlv5mYPDG0C2y0s2oMNAV/X38vyVsTnuszGALBxsgDTiD8bg6YHfPqng94wShvOOlS9A8plqt2XwQcKNAM9RJDQZtHhbn/JYk36hwrWyCLoWNQoU2YdvEAeOVienv2n3VBFLango4tfEQS+7SmuZ1YJ/yhceDb76AuVcB9AOAPmeYKY3RjUD6VhNQpV89UVOEBXcfEuZA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T66cH4wTDmAaU7yc1d8iMoW0cWTll9Z+7y0AohTwaltrGSF9ffksswp+vwYMnnplU89e4dfCbWcsGK/H0Q6K+EjJMFlBWCAXMf4ZodhjqT4Ubr X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: "Alex Shi (tencent)" Only single page could be reached where we set stable node after write protect, so use folio converted func to replace page's. Signed-off-by: Alex Shi (tencent) Cc: Izik Eidus Cc: Matthew Wilcox Cc: Andrea Arcangeli Cc: Hugh Dickins Cc: Chris Wright --- mm/ksm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/ksm.c b/mm/ksm.c index 15a78a9bab59..d7c4cc4a0cc1 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -1518,7 +1518,7 @@ static int try_to_merge_one_page(struct vm_area_struct *vma, * PageAnon+anon_vma to PageKsm+NULL stable_node: * stable_tree_insert() will update stable_node. */ - set_page_stable_node(page, NULL); + folio_set_stable_node(page_folio(page), NULL); mark_page_accessed(page); /* * Page reclaim just frees a clean page with no dirty