From patchwork Mon Mar 25 12:48:55 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: 13602022 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 A0FADC54E58 for ; Mon, 25 Mar 2024 12:46:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 31C106B00A4; Mon, 25 Mar 2024 08:46:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 185C66B00A1; Mon, 25 Mar 2024 08:46:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ECD5D6B00A3; Mon, 25 Mar 2024 08:46:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id D33556B00A0 for ; Mon, 25 Mar 2024 08:46:10 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 75F88C066D for ; Mon, 25 Mar 2024 12:46:10 +0000 (UTC) X-FDA: 81935534100.23.3333279 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf18.hostedemail.com (Postfix) with ESMTP id C43C81C0020 for ; Mon, 25 Mar 2024 12:46:08 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Q6AU0w0G; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf18.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=1711370768; 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=CgdU2ldzb6Q1lsQxi1OyvuCL84QsEiZRjwXqHJ8gUzE=; b=e70drT0YiW4/kyKKSDzxPLo8/jejaCl0opCgOxnYlDS7siVs7ndtt2/IsxlnYObCE+2zmJ fMuIpps7L3aeYTi3VBFaq2uU6+i9v0v70p4gtGWs035lYpR+Tb1AiXlkEIjAOb82N1qgPb p7KRyRzOj74g3fDiNuumTzCVBQU8IvM= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Q6AU0w0G; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf18.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=1711370768; a=rsa-sha256; cv=none; b=s2Zs+7uETa2KH+2YG6Q6AqOhn3ohTZTPBsmdM5oI1OWj14+a5fW6+GEbguY/GHgAP1PPPn dIzJBQRP5zFMCzavamBcNHADsXKLywK3Tk265vBiojOfHkvBNblbQlUsJGuFJi8heL01n9 +C2yE8qyLsFA53Lm6gCU5+FKviajJKU= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id D08B060FAF; Mon, 25 Mar 2024 12:46:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71F09C433C7; Mon, 25 Mar 2024 12:46:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711370767; bh=1FMqhrTGzv5mI88ql04GgunChyuiZ5EvE2fgo8IbQMc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q6AU0w0G/erVGHeJFCX8w/EJeqQFE15Jq05PpOfDQBhQz0mLQRG3ULcPNL3SLertO hm4n2HJMGH+yHfEe8vGRHIR/elq9l+W/2TbpJZ2GhGaruVJ01wKwR0R7Cmca21hYkV xFOaBsAKY2ZQPFpe4yhgc4Rzny2PfvvMx/gv6TAdu0j3fMV7kgXUoDoZaBVb4GU+2y /aPGy4PlY/7p0uinoDfWfyGGQWsWOd+zgrV+h+f2TvnIx5fTUhmTu7a4xO7oracQtb ZQnNvcIT7N/spzY9RL0DCzzdiFMFj8Q99B+mVOCimWgsSOHsYZEdx6ErXYixa63Cz6 YAE22wFF72Aog== 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 08/14] mm/ksm: Convert chain series funcs to use folio Date: Mon, 25 Mar 2024 20:48:55 +0800 Message-ID: <20240325124904.398913-9-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: C43C81C0020 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: jns57zdmzxx36gsnofco6ztn6ej9i5uj X-HE-Tag: 1711370768-532679 X-HE-Meta: U2FsdGVkX19zIMUBu39Qq/S2j0xWUoSipHpevQvg136Txic88hJAoLM30nne269Ybe518h3FKHAWSfkq212oOb2jyC5XzYwpp/MO/r/3bL98xj9qD7xnvKiVlLZqCITdr4OGi8nRqTcTdTJwVbReGcDivHRilXUckYIaUqtNzO4N3X83hwN3kOlxGM0zPXuoPeH9niaVw828jhanY8/i6O4zfFVIQyempuJ3Uogi4BEABxjOOiha4JBaJ0nYdb7XpwDv9Uf9kxPbhpG66wO0AGrRunSi90dZaJ4lwMyJVvXgdKLYAf0o81HWGG3C5Wzb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ZvdJ1YqhkYvjyvpT89dipVoJoZ2j2ZQKT4uoc3lI6NT2IhNlHx+b/yYGnaw= 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)" In ksm stable tree all page are single, let's convert them to use folios. Change return type to void is ugly, but for a series funcs, it's still a bit simpler than adding new funcs. And they will be changed to 'struct folio' soon. Signed-off-by: Alex Shi (tencent) Cc: Izik Eidus Cc: Matthew Wilcox Cc: Andrea Arcangeli Cc: Hugh Dickins Cc: Chris Wright --- mm/ksm.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mm/ksm.c b/mm/ksm.c index 5d1f62e7462a..7188997437d3 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -1777,7 +1777,7 @@ static struct ksm_stable_node *stable_node_dup_any(struct ksm_stable_node *stabl * function and will be overwritten in all cases, the caller doesn't * need to initialize it. */ -static struct page *__stable_node_chain(struct ksm_stable_node **_stable_node_dup, +static void *__stable_node_chain(struct ksm_stable_node **_stable_node_dup, struct ksm_stable_node **_stable_node, struct rb_root *root, bool prune_stale_stable_nodes) @@ -1799,24 +1799,24 @@ static struct page *__stable_node_chain(struct ksm_stable_node **_stable_node_du prune_stale_stable_nodes); } -static __always_inline struct page *chain_prune(struct ksm_stable_node **s_n_d, +static __always_inline void *chain_prune(struct ksm_stable_node **s_n_d, struct ksm_stable_node **s_n, struct rb_root *root) { return __stable_node_chain(s_n_d, s_n, root, true); } -static __always_inline struct page *chain(struct ksm_stable_node **s_n_d, +static __always_inline void *chain(struct ksm_stable_node **s_n_d, struct ksm_stable_node *s_n, struct rb_root *root) { struct ksm_stable_node *old_stable_node = s_n; - struct page *tree_page; + struct folio *tree_folio; - tree_page = __stable_node_chain(s_n_d, &s_n, root, false); + tree_folio = __stable_node_chain(s_n_d, &s_n, root, false); /* not pruning dups so s_n cannot have changed */ VM_BUG_ON(s_n != old_stable_node); - return tree_page; + return tree_folio; } /*