From patchwork Mon Mar 25 12:49: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: 13602028 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 9F0A0C54E64 for ; Mon, 25 Mar 2024 12:46:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 559446B00AB; Mon, 25 Mar 2024 08:46:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 506EC6B00AC; Mon, 25 Mar 2024 08:46:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 381346B00AD; Mon, 25 Mar 2024 08:46:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 21E916B00AB for ; Mon, 25 Mar 2024 08:46:25 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id E0ED8A02A9 for ; Mon, 25 Mar 2024 12:46:24 +0000 (UTC) X-FDA: 81935534688.29.764CCF2 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf17.hostedemail.com (Postfix) with ESMTP id 4953940010 for ; Mon, 25 Mar 2024 12:46:23 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=R4e1gCa0; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf17.hostedemail.com: domain of alexs@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=alexs@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711370783; 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=h+Hdye/l8cDHzb+vok3my4tAufoPVguZdfvQoSARGT7hhhI531m5Bfxwt9/fRKqqn7QAQM qpKdVX80iYTOTWLUpEgMnD8LWEzpcTBVZNNCjxNR2s53ozEnyjcicRLa20+ArEPtr6lTZU Oc4+i2bOYHAZJgZZbqAL5S8M9bfVrgs= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=R4e1gCa0; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf17.hostedemail.com: domain of alexs@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=alexs@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711370783; a=rsa-sha256; cv=none; b=QhIjS/gNyT+HbAF9uBuhkVYFL1yhCUGpKNAk/5qv+WuZvXaYEwfLboeyYK8FQjgKJuJSOO Sq9Vd7QIbiAEo82/ydQqQ+N05YK4Ljok6/yHOBLK/hhmK3qJSbasowZl5fWZeuOo2VVSee Qstr0Ormf2qPlcG0gNd8+F7X+amG3Vo= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 8B09C60FA5; Mon, 25 Mar 2024 12:46:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07108C43390; Mon, 25 Mar 2024 12:46:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711370782; bh=ZriKAGE58KVGgk3LtHqsYBhdOJzv7LI/X6J606D1xxw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R4e1gCa0XXthXxDX1BVjSpCwAOrXN3yXEnOKgM7VQzdWV57yKkfcA6jTRuemNBpPk cB15ux/wXrKv9yHhvUufFYr2882U4OjiVTCQGdfIigsmAadPt7KopB0roJ8VFftt8a ui44vFdFuoIKw0rV7d8UOx42w2pV8KnpkkqT4L/pnhwDAT6g4KoPWYmZB8HemEl3hU bkNVVJKYJ6yao6nAcZx3Z4aDvnCRwp/dX041t87HyEv3ahSuOCQwKWNtjXiz/IZKxf F5ssZsBvG+eP5J/A2c32/8//4yXzJ6pe4Wgcr9nhm1SbFY4WMaTTMJVug1bcTPZTb4 EgwXN9kXAKISQ== 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 13/14] mm/ksm: use folio_set_stable_node in try_to_merge_one_page Date: Mon, 25 Mar 2024 20:49:00 +0800 Message-ID: <20240325124904.398913-14-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> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4953940010 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: 4a9oi1a8cmkqbm8xe9fdgzousmzwznpd X-HE-Tag: 1711370783-905798 X-HE-Meta: U2FsdGVkX1/aBqPzD3bJsQSzMzmED2skW93T953nI286YyodMnLN+T/RD2v/f4XhR6Wv7Zy9QE/vj2v9d0Sqijb/MGaqR12C7IgSoFQ9KYR7Nk7eQcfs1Fo397Tr1HqrT6gqUhHFxnflednoK/EWct34XV7HkLHKWUV/F1gnL+p5s039izQBytoW6XY4TqcR0cN8wpUa9AYyqoQOUzFR3Z1XXL58DauT9Y1406Vx3MildyiZgHR2VnlsPHeLLZkpzDCkv+GlBdqWRLcO5pqQiGYGu2yRd8usPu016ZukQ9U66ooybSeljC1dvf3HXnyMEap6aBHYBBUmB+9XN30/R6Y5tCCX04WFENGEoYTY0D2/MqZehydIrv7Qu7pDOTaL/qSe53RywwJiUdt/33zyvMvbr9Bl0TVuGRjtqV7Mn0lgN7Vy6+orm6HDD59wdMTDNDwBIPzJmgS00p/EyJH/fp4FLmydnqWs1Zeow/GY7sIwQNgxhqy8KeABcjCZCvOaXF9SOWFEsFBSof3+pp+USoi+9xFfzcbv6DEqOB8pbRfK+1vBsmrUIvVSDpfut9yn4wxBkc3AgG1XA805yp99+xaEuZuZ3IGGKjadD82YUEjOL9ul4TxVb209GeZsmdV07xcH4CSbIb6R8BnKcKpCQZpczjYzLFDfubEqgQ7yRzXXvGiB3Oz3GGzhNM9jqBb86w3GXF52EhQyJkY+4tLHxrFCJplX8cfsUsDa/7dzknwD1UUfrdSzRoymyiGGFpgLq947pp4HWw+WCX6GwQ8OdbptNr4SUMdjNCZnDK/1d8bHmLEGF/KkxqpHqSK3Z2FTjWcMoPOlVMqfht1BC99U0JyIwSjEvSbP18wCA+c//QCEV2XHUz+gH/BUQm0O4r+Q3ADXt4AOXGrJfPeXk7IKZEnJRFFNX/vTkenSCwd4QroNKKPKn051zp+XRDNqd1VVp3TVgEPjFvhvysnWti/ O91kxslp jWpxZ 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 Reviewed-by: David Hildenbrand --- 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