Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp979956lqp; Fri, 22 Mar 2024 01:38:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWj1P9ODezen7HZ0G16UiWwFaSWyfrhjbMxcKz+6yIJOYXxyYIkGJ+WxX2UqgMn5PuW1rkrydrdbhSEAO6QkPnfoPIY/VCPSYinipEBZQ== X-Google-Smtp-Source: AGHT+IEXogdw8e8ckAoMXOwU0PnhR0f5h9aBCr3YldHYLVXZRuoc9NsES0A3BJ9a0HyGkO0vU9lE X-Received: by 2002:a05:6a20:918c:b0:1a3:534b:3211 with SMTP id v12-20020a056a20918c00b001a3534b3211mr2153902pzd.8.1711096730846; Fri, 22 Mar 2024 01:38:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711096730; cv=pass; d=google.com; s=arc-20160816; b=e1Itgs4VLduiADNm1IPuX2c0jjDWKQknyBksiD0Uzks43CZsezV5QQMUGUdNgOrI0X 7CawrLIU75r7T3N9e3PraXERtVcsycRaTxycmww7gt14boyA/3QSe/W8MlSkry8YNA9o hHdDIUSEOUyLPJ10RxG8Z6CvKuK/TmPPCbK1RZlkIDHN3UzfCnkHr17qp2ISA5tPEG25 pNJ/SN2oBjmsjs9PF7ZsyfytbGyMXe0Gg5NbIKXF8yQPD/UssoUCcFROix6HdPhwsdyl CpHlRdTqKfYWfeP4t3Yt6PKNxFi73R1oJcHXjUg2bOLurd5qJhSBKnyk1OGGCNwn+pxv J9CA== 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=+Lap9gokREHM1CtNYHdd3OK1hASI/gvEjkP56yp8AbE=; fh=CTFdFrbtP7Z7TCdMbqsgkrQi425Yz+qx6YS+cHHF8Sc=; b=SojbLWOR/LiLjH2lG/p/v6IIDQeaBj/kY5v/NaVZFyflAPVInu8qkAJdVQXtvOUYFD 1HW0/Nd3Ef6noloPf1LQHvEnvnVRgjRvOb9qUZXI377MTLxL1JNcCBa6LnqJItLIv17d W5nlEdmtx/YJvEVdLkw52fYZtvYUQaYrIxX+p2ISodzIdzaK3+J0le5KzKuAx1iU7MMw w0e2ZHGPGjzyxzBQ3WzPbo0OUdC5GcpuVJnqSvX881nW31FtiLBJyNxQaSgiHrQlyN+x I4B+qVblZWpNvnctqyn1SNoqLKxorNEyS66n91w9HpqmO/NZgWh3256fLrHa38XiUUZQ OczQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="fj4/oAXX"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-111141-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111141-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id c4-20020a170903234400b001d4ca2fcc4asi1537109plh.291.2024.03.22.01.38.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 01:38:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-111141-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="fj4/oAXX"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-111141-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111141-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 6DA1EB24852 for ; Fri, 22 Mar 2024 08:37:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8FFFE1F5FD; Fri, 22 Mar 2024 08:35:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fj4/oAXX" 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 BBD171BC3B for ; Fri, 22 Mar 2024 08:35:06 +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=1711096506; cv=none; b=oGowsEH6U8IjvEFwmCOOQKNfHQyA3yc4HdrLCm1y1OzY+0FjUNrupngYdIHruvsc0STVf7qNHzY/+O3ENYFNkTITNDthqr/jtwAn7jU15/TFTm8UReyOaJZPDvpewhqa5VqLkFpQIzMen3qBiCQ9pJfPrlcykmsvJ0rnBpSn8bk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711096506; c=relaxed/simple; bh=58CYkIGbUXi9LAju+yb3HIaI5P0/xOPsOLCuC4bYl0I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=d7CaGpKyMaq0RFpYTzaIIMPY6LZztw5F7hFVY+32qHGK+DXNlKVmwzBwoErlBpfKk2kFz12Q4kcHr/uXeLbtI8mNMJMGVb9FxyRw5PFYixxexKNVligSxenCE+vMLmLxZKqOONUd+UYq7GkHNMSUgwEJXndaXvv99xEnESlVvUI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fj4/oAXX; arc=none smtp.client-ip=10.30.226.201 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> 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)" 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; -- 2.43.0