From patchwork Wed Mar 20 07:40:47 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: 13597425 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 7F86FCD11DB for ; Wed, 20 Mar 2024 07:38:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2D6798E0002; Wed, 20 Mar 2024 03:38:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2129B6B00A5; Wed, 20 Mar 2024 03:38:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 08A118E0002; Wed, 20 Mar 2024 03:38:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id E25366B00A4 for ; Wed, 20 Mar 2024 03:38:14 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 7F0B1160B7A for ; Wed, 20 Mar 2024 07:38:14 +0000 (UTC) X-FDA: 81916614108.21.054F350 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf01.hostedemail.com (Postfix) with ESMTP id DA95540005 for ; Wed, 20 Mar 2024 07:38:12 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=JJwpJSdF; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf01.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=1710920293; 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=fWp2INN/oXeQRE6IS5X40tDerR+6irsQ/sE/nbJlu1I=; b=zew63doTFPnXWXqT1nmJk1xGTfUXOeqFmOnBvOHuMYL4D1Hg/itCs4TckNmtiqRy9k5Ddz C6YvBn1b5pOT8GxQHxp08xLkFLUXyJBbmJspWU+0hSqu4TSMHcu7350Vmq74uKY96vJPBM qCESoIISOHmeCgifRlA2+k0JQwf+w3M= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=JJwpJSdF; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf01.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=1710920293; a=rsa-sha256; cv=none; b=nKIQIS0gz2MN3yys562wNaWCQDGXzNeDXZ7mNGql6IjklhflKxWLuPNiXPI1th3KJQ0lz0 ASOWeL4GFQm/oKs9X1UlUYJj0+cDCFJiZsjI/yl1gfLJGltM6qXePfJtdgokIQNdbEwYU8 Pe30rLldOpLwVr+Kz2yDxV+WB7nktAc= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 0A8CF60FE6; Wed, 20 Mar 2024 07:38:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57DADC43399; Wed, 20 Mar 2024 07:38:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710920291; bh=2eCzaBD/FPlVUCW+3c3mpz0T6iG1rGJcXt6EJeYetoo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JJwpJSdF8PMQwKdjVsH6aJlrbH9++/7WiZkEWLeurmSr+JfpMJKrW+x4hDWfZCJfn dnRIC5q3bejKL1Rdjecw3lZ9mQfSrOecTOhXOsUmFmCHmT3nzZdOxZglTE6xGXFO7c jXeNkxlgkQZ5SMTxR8JJmBr2KNActnCXSpXBACqkNiERLUIZslmxWTpMsWwLpIjOeQ NXmB9l0gy1Jr+wUf/lw+AMatfNFMp0xfp0CdxVBc+c1jcuJS66HpsTnovaxLpVG+/k CXUcwj2LgYj6pkUzNz7WZ7VHtMwZEUn3E7O+PeCIqK7vRhs2kjEoEK5Mn7mwWr/nLx nLX9yNep5BLJA== From: alexs@kernel.org To: Izik Eidus , Matthew Wilcox , Andrea Arcangeli , Hugh Dickins , Chris Wright , kasong@tencent.com, Andrew Morton , linux-mm@kvack.org (open list:MEMORY MANAGEMENT), linux-kernel@vger.kernel.org (open list) Cc: linux-kernel@vger.kernel.org, "Alex Shi (tencent)" Subject: [PATCH 11/11] mm/ksm: return folio for chain series funcs Date: Wed, 20 Mar 2024 15:40:47 +0800 Message-ID: <20240320074049.4130552-12-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240320074049.4130552-1-alexs@kernel.org> References: <20240320074049.4130552-1-alexs@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: DA95540005 X-Stat-Signature: wfjmu6tnt1j31wfzxg48wg8rare1cyjo X-HE-Tag: 1710920292-146871 X-HE-Meta: U2FsdGVkX1877ToD2VMcjeEO4Aeb/dmY1GDVF9gTJ9YjUNhHtPuECNmgtBFty/CWRylXokMl56Yp5QWFWyIOtmYUEc6/JLLb4wqqmWkdn/BUot6tJdoVVufnAnMqt3SJTD+rltdSNdAxGyTP0yl5aZT3ANOjeUlKtA8uwnSGiQnQJm77Z2iv7QaqkZQk7WLFfXnAAs3XRkIcoR5UmA7dkfP38oe8c5DYiPQzTEX1dNW8V6YnbJNYjI+nQEW1UUaPGX4vKR/lxXoV/xO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og7vbbdamkwj0UNSZuk2qxd9WGwhCpZBq5qCUThsstHbdGq2utTHrkdQSPxj8uxYuwv4NiEmN6vf9VAVioltKIWmAkOpGuoXyNSK4aQ= 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)" Since all caller changed to folios, change their return type to folio too. Signed-off-by: Alex Shi (tencent) Cc: Izik Eidus Cc: Matthew Wilcox Cc: Andrea Arcangeli Cc: Hugh Dickins Cc: Chris Wright --- mm/ksm.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/mm/ksm.c b/mm/ksm.c index 806ad4d2693b..74cf6c028380 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -1615,10 +1615,10 @@ bool is_page_sharing_candidate(struct ksm_stable_node *stable_node) return __is_page_sharing_candidate(stable_node, 0); } -static void *stable_node_dup(struct ksm_stable_node **_stable_node_dup, - struct ksm_stable_node **_stable_node, - struct rb_root *root, - bool prune_stale_stable_nodes) +static struct folio *stable_node_dup(struct ksm_stable_node **_stable_node_dup, + struct ksm_stable_node **_stable_node, + struct rb_root *root, + bool prune_stale_stable_nodes) { struct ksm_stable_node *dup, *found = NULL, *stable_node = *_stable_node; struct hlist_node *hlist_safe; @@ -1761,10 +1761,10 @@ 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 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) +static struct folio *__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) { struct ksm_stable_node *stable_node = *_stable_node; if (!is_stable_node_chain(stable_node)) { @@ -1783,16 +1783,16 @@ static void *__stable_node_chain(struct ksm_stable_node **_stable_node_dup, prune_stale_stable_nodes); } -static __always_inline void *chain_prune(struct ksm_stable_node **s_n_d, - struct ksm_stable_node **s_n, - struct rb_root *root) +static __always_inline struct folio *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 void *chain(struct ksm_stable_node **s_n_d, - struct ksm_stable_node *s_n, - struct rb_root *root) +static __always_inline struct folio *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 folio *tree_folio;