Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp979515lqp; Fri, 22 Mar 2024 01:37:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWEC4ExrCJnYcdBBPFH1ua5NYAvAZN12desIZkYw5vnEAHslqN6TlP2iEHUb1mMuWCZzXFG2uL5jRSrK7FmEaXMUY0VV2Oh8MXXUn/HGQ== X-Google-Smtp-Source: AGHT+IF4F+5di2REMgtvyeDVy2Bk1QiuNYHDmXxWDZdWFWs7SKVighJTnl7t0wjrsjK54RE2RwSo X-Received: by 2002:a50:8e5e:0:b0:56b:a8ea:964a with SMTP id 30-20020a508e5e000000b0056ba8ea964amr984893edx.9.1711096654020; Fri, 22 Mar 2024 01:37:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711096654; cv=pass; d=google.com; s=arc-20160816; b=KqJbYo0GEnS/pueYcyb0sjF3jK8K6zmlop3kp3S8+IIK0zJss+E72QYdxKbJGrtDbd 6Gp5e7oLrOwtLz3ubp7s/TmRdxn2OzoiRQpj1vpg3knW1qOWsMJWU/KvhFJV/Prqgmbo Gv0V9uY/QYSz4e+FM0wAUAPEBs1j4/iVEIUJPLeaB5RqPHce+MNc+sN24GzSepPzQ3Jd U0iNYMgaodn4tOdZ7s/dh5gCclKSrDOGMhDA+Oy0Hb5c5WRHWsuHEVpzvbXiNX4ymjo3 YjCquc7Z31yHaVr7TyHn26UmacXYaa2gaHV1dxQnOWNXYPHUpmn+w2M1x45YkbshPJqe BgAQ== 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=TfVtUpv+bViU5SEY+5vl7RzuFH++KFzflA9vTjEeuyc=; fh=CTFdFrbtP7Z7TCdMbqsgkrQi425Yz+qx6YS+cHHF8Sc=; b=sGXRFkFkZndcR/4x0DRDoRh5xqy2TPYDceIubW3fSUOjp82uR7ImvOOVEu0DjJIeiJ 6KAt1uYUpUc1Jb2yfAcJ57EsMbn993ScBiY7/ECHqPogMG0JfozdR5BqpL3Hi6CWvDwY S88LX1ReUxs4LvNqc+r3UML9WTv68hSL9X/qwrKjjmgKxzvplxSY/zkKED1GZCwBg6qv T+RoyfeQ6N9FbWHHMNYjVh8NCHQI0MQeHVWRiCjbvAY0u815EcU/dEy/C+MdL+qCfuZf vHSg//UyIFSOvynYawiesl/pT2Yl7t7YJFdPii6pYNY5sYtad5NRHBDt9Gw9LEUOwSsd TgFw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iAcwg2U9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-111142-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111142-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. [147.75.80.249]) by mx.google.com with ESMTPS id h27-20020a0564020e9b00b0056be88833b2si147541eda.460.2024.03.22.01.37.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 01:37:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-111142-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iAcwg2U9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-111142-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111142-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 B7C1F1F215D6 for ; Fri, 22 Mar 2024 08:37:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AF4C83F8D0; Fri, 22 Mar 2024 08:35:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iAcwg2U9" 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 DCAAE3E49C for ; Fri, 22 Mar 2024 08:35:09 +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=1711096509; cv=none; b=HGCPXePCAJswK4qKRViNfuvavfP/YQym/T7+nAPSKG0TNqCx5vj3XEtswfmGr6HURzilqSaPkMl+LHmsYIxGZa3C5uNxy0dr51Y1Paw1NhqkpZSLnJ3/WlEV7k6078b1/6SsY/cMED58kWkFooGjo4W1XsM3EiQ2i+o9jtjMK2w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711096509; c=relaxed/simple; bh=ZriKAGE58KVGgk3LtHqsYBhdOJzv7LI/X6J606D1xxw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=amGCau8IYuNXm1CpHCENjGYtzl99bQISG8uFCNZwe+7aTxBXWoSPpL1AUKSzoGc6DXSWyWTTbHJ0s5BIZoNnmibr3vE/QxpgLjoNoZDjs6I6bV10dc0Cku22h2KPhlO1UTsZ2x94nVEa2ziSIC5xLDTNX7aPsLv6K3dTmxQ6z9Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iAcwg2U9; arc=none smtp.client-ip=10.30.226.201 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> 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)" 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 -- 2.43.0