From patchwork Mon Mar 25 12:48: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: 13602026 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 CB257C54E58 for ; Mon, 25 Mar 2024 12:46:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5CB166B00A8; Mon, 25 Mar 2024 08:46:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 57B636B00A9; Mon, 25 Mar 2024 08:46:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 41CF96B00AA; Mon, 25 Mar 2024 08:46:22 -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 2E45B6B00A8 for ; Mon, 25 Mar 2024 08:46:22 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id EDDEB1C04B0 for ; Mon, 25 Mar 2024 12:46:21 +0000 (UTC) X-FDA: 81935534562.27.DA79120 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf10.hostedemail.com (Postfix) with ESMTP id 4CA6AC001C for ; Mon, 25 Mar 2024 12:46:20 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="Rff8wy/g"; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf10.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=1711370780; a=rsa-sha256; cv=none; b=ZZ7IB3O9/D9N1y3BV90Ya853ywI1fC+/V1N+PJ5qw3PIssbNR1CeB8ioWTmIJHdlUADp9Y skLe6GzGm0fxCIvdyLhlHgitjgSZrtnA+nc3xYNRtqIjy3w+F0LzSf4196mEvNuVr5OHkU vnI8aBvXaL8fwSQ4UazfquYy+JdeEu4= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="Rff8wy/g"; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf10.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=1711370780; 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=Su+w/May3HQEw0sTqjdP5gpPsA6SjVZVsA3paXcbads=; b=rkTO8uvSv6I3I0Evp+5bB5OejaML+yaKFJJXcwbCQtXbXOV5e5NE3pbrTtxsjSlAkc0Piq iKp/ge2pnaN8jHaDcA5gBWfSqVIoBf2RIJWnvQAuCRk6Zx3Ook7FtS0Xv9lKizQVU++2bH vB3zqniZdYScDAulHc7YXkygA6sk8HY= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 95CEB60DC4; Mon, 25 Mar 2024 12:46:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38D82C433A6; Mon, 25 Mar 2024 12:46:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711370779; bh=arZB3IpTCMJ2LTtZkVucxq3hez+AmaxlVxPKhMFKVEk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rff8wy/gttXaTtUeASAh+hMee0l3Szue+pd80LQ7k9jBYU7wpVMjckiX7PPi/CCDY JmtuOZ96Z9NiUesHdgS7I/17APw8F8a6shAI8Hx0MOMOvcotCH045NHl0562JFdUyM uR63wRqfAstz1MfVQh4UgDxGwrvMYSPNgwH8m5jXkWM2VQXmwhd81SQ4FTsCp/J4Zi ASIM7LKrdIOomYptlMN/ZXGzrO2+KbvRDrzVxpWKq6zTzqlN44ppN7BDBeNUcjUeaf +s7Q5kySAFuGKdy+Puod7mj35GfQEifImvDyWAVmGQxwyF0PB0kNQk7JtWv3EfKXTS QBdN/da9IUlNA== 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 12/14] mm/ksm: return folio for chain series funcs Date: Mon, 25 Mar 2024 20:48:59 +0800 Message-ID: <20240325124904.398913-13-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-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 4CA6AC001C X-Stat-Signature: w9h388ecxnm641g8bib6f8s6c18ruosj X-HE-Tag: 1711370780-602171 X-HE-Meta: U2FsdGVkX1/gV0hFw5patbAFY2e9QPKRcRKuHJm8LeFYegibSyvOPkd+j0YupyH1v0SAF61d9SpztKaxbyQwYBZM5zwZnFT6rrlA34ttXkVVB9cJPOy2pQ+Dn3sDnzEMqBLsXL5g8F3B9DntERanU8ml7qHm9uriryFSgl/eiN8Q5Hstso1dt75udKm6sq4k5bUkVNG0C+zmB4qnVkPjAlxB5pI36zZtEVwkj/PdGYz5VDcp8cnhO4KlWqp7m3KcRVZY1V8bDUDdUzHn86QcHAX6Hi2I7YVhH8QSuZzh++E2jhz5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EjvmQI7dfE/N8RC3dcC0aGy6/MSwYa5W4yvhairPAj5eLI6MoC0txElnQD4UE= 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 | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/mm/ksm.c b/mm/ksm.c index 0ad02524e363..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 struct page *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; @@ -1739,7 +1739,7 @@ static struct page *stable_node_dup(struct ksm_stable_node **_stable_node_dup, } *_stable_node_dup = found; - return &tree_folio->page; + return tree_folio; } static struct ksm_stable_node *stable_node_dup_any(struct ksm_stable_node *stable_node, @@ -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;