From patchwork Fri Mar 22 08:36:59 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: 13599739 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 25D6EC47DD9 for ; Fri, 22 Mar 2024 08:35:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 380336B00A6; Fri, 22 Mar 2024 04:35:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 30A176B00A7; 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 137466B00A8; 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 EF43E6B00A6 for ; Fri, 22 Mar 2024 04:35:12 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 9A9E9811DE for ; Fri, 22 Mar 2024 08:35:12 +0000 (UTC) X-FDA: 81924015264.18.7F08DA5 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf11.hostedemail.com (Postfix) with ESMTP id 5FAA24001B for ; Fri, 22 Mar 2024 08:35:09 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="fj4/oAXX"; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf11.hostedemail.com: domain of alexs@kernel.org designates 145.40.73.55 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=1711096511; 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=+Lap9gokREHM1CtNYHdd3OK1hASI/gvEjkP56yp8AbE=; b=vxdP/guoEFSkTb41WiE3c5hNpS/46zOgwNdwEhjRaFP5x3jsPaQgeCx223JvRS2qAcpYfb XNBfVX6YbcAOc7hiFxy9vWkTmP7CSEWp7kL3QwAK0q6jYQY16C+nvuTy+Yw0yMAc1EDbYC Fpse6hGs5r5Z0XlA1VlI+GCduAYO2nM= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="fj4/oAXX"; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf11.hostedemail.com: domain of alexs@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=alexs@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711096511; a=rsa-sha256; cv=none; b=iSeF7tl7ZJ5Mmyyjpe8qWM4ssyQW1IGYYdf/uk4QG4YZqgGSX9/Wz0iE4Jb7Gk0etpFGZE rYm3PlHrgiFk7rf41pfm6GnJiDykyB71klqqMcaJVNiK6qd2+FGyFwwUB40tFBxLe6vIlI 3w0WK9yFEWn4gre4BaM0bXRuZpif88Y= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 76814CE1779; Fri, 22 Mar 2024 08:35:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45DA2C43390; Fri, 22 Mar 2024 08:35:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711096506; bh=58CYkIGbUXi9LAju+yb3HIaI5P0/xOPsOLCuC4bYl0I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fj4/oAXXwJyK+lHuDuYpq+4X/X/wDs8aqMGx/io2Y3zhIpzKnZ2W8eoxDqdGLWBQh HwOg4I/Ld12Y6pOsSFTvCvXolR8RtLGSxIn4SsrsivuZhZg2LXyp979uG+TYpMIO08 Zmam5au1soDjXTNv/A6/P1VgSggAI7xIzJ3UxNmqGdXRLrVNqpj0YYKIDl2Oq33eyw FyEneaJRsoSxoubL3WMyaCjxt/SetSyb5la5KpXDdNHkbmk2W1A3g2ojs8q+F1+80Z Z+Z9kFNFmk980SrvTfKIhObMlUuK4Z+77hkFoOHgVGZUOzOnsHGQ3f4zX536gcsn7n sANRg6w7jqrIg== 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 12/14] mm/ksm: return folio for chain series funcs Date: Fri, 22 Mar 2024 16:36:59 +0800 Message-ID: <20240322083703.232364-13-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: 5FAA24001B X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: wrwz57mtowcfqrkb9deerb36dha5tkim X-HE-Tag: 1711096509-2859 X-HE-Meta: U2FsdGVkX19atslSObwjZ86h8BBdB2dtQoEnWx1KoY616Kdrm6JV6cIXxCRl0gvyYVQynWT2N2dDK4eGFYHGtDnTtBpZ9MqhizkKUYTyMekWyYgvZVMMy6aoTGZcqWtxogkw1jki+xDd3M/anccf8zCxlRpfqbwpVtdkcgvFCrKFx/TsRv5X5JlQ4XBj6MVHCTJqUuRRN4mk2HdxoXncZi9/7UUlfy6r+tY5ryOUmp6tIurD3MWbY24di+s+NRpRa2LeY6iiOZjGicGFEissRO1UaWNoj0q/5F07kBKv1FCl+lllHMjzadLdhQ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gBzC/WW5ESgH8cadlNuc8ztIvTX+1zyaXIYOLw/j+xvVjRRv+jXXPruW7R7kGLUY= 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 afcf26510669..15a78a9bab59 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -1623,10 +1623,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; @@ -1769,10 +1769,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)) { @@ -1791,16 +1791,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;