From patchwork Wed Mar 20 07:40:43 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: 13597421 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 8C287C54E58 for ; Wed, 20 Mar 2024 07:38:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C26296B007B; Wed, 20 Mar 2024 03:38:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BD66C6B009F; Wed, 20 Mar 2024 03:38:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A75A46B00A0; Wed, 20 Mar 2024 03:38:03 -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 94F986B007B for ; Wed, 20 Mar 2024 03:38:03 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 74D77A1569 for ; Wed, 20 Mar 2024 07:38:02 +0000 (UTC) X-FDA: 81916613604.29.5793178 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf29.hostedemail.com (Postfix) with ESMTP id 6D162120014 for ; Wed, 20 Mar 2024 07:38:00 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=lhCa2Ax5; spf=pass (imf29.hostedemail.com: domain of alexs@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=alexs@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1710920280; 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=bZRLc1zIpAsHLe3qAuELxC9pbVO96Bp7szB4EtEAC0g=; b=V1RNl2rMIczV1gggKXeqaB0Q5OT+25VsD4EUkF17yvj5L+SNb67K/YawIZ0Zeq0rsrnhzW rbnyEidXPeQCr1LyO/RuL1Agj/6i0nUhZwbgzyCnvXmtOBVZdJhypj6jSTbBcHVUVwpqcm 1mBb5bBHYcR1nhy05FPEYPk171fghSM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1710920280; a=rsa-sha256; cv=none; b=1B/58CquaKse1SU7S43Fu5jz7ezqHSXtKXpgH/rfzQhKiycRu8Aft8fBrEdX9FXqfZY+Em PpliZjCBe7ZsNvpGUoffi7rfrM9jLLxu29avm6F05i2ixWNLlE9FkYgQaE9FwQIwUilb7R IUjHtIdb7qVJAaGlBlwg2+4nI4CJ1CQ= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=lhCa2Ax5; spf=pass (imf29.hostedemail.com: domain of alexs@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=alexs@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 7EE02CE10B3; Wed, 20 Mar 2024 07:37:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9CD8FC433A6; Wed, 20 Mar 2024 07:37:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710920279; bh=1ed6BHhGoxgGo7EGuh+4C4k7rhnha86RpFOxOMhqKzo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lhCa2Ax5ueUSpXQj0Ttzhxb1k/1JVJoGcXSZZKbOYPU0aS/96v+eP5ke/tSy7N662 6DPmG+505PRZFGCUnmZSCvPx3WlBVs1RRA0XcpitnGkrM4XpfG2+lYZchImhrASWGO EcWQvcNxlf6/hHiuh7IQY1B9Ic3LnWLnJ1jLpMPMW2/8EzOLrr2wPG/KRvzYgT9yHn CpugyVk7CXv2ky9jyU8gzOp79le3M7KmVcTXdeeeBhTuDBXOVcTN2YtpAL+FUBdK0T PdRNe9PQZwHr24y72ln6sr4/2fihO/p3mT3hoZdMOUfNrybuYUqoerKx9wGy2IoKy0 Y13qi1nGB8Gbw== 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 07/11] mm/ksm: Convert chain series funcs to use folio Date: Wed, 20 Mar 2024 15:40:43 +0800 Message-ID: <20240320074049.4130552-8-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-Rspamd-Queue-Id: 6D162120014 X-Rspam-User: X-Stat-Signature: cibuzsf5ikgnqkqh8xgqe1od5dsmadmo X-Rspamd-Server: rspam03 X-HE-Tag: 1710920280-336423 X-HE-Meta: U2FsdGVkX19wQfYiFU+0g4GVPjLm0QpT8hx6W7DYS2hpz8PDrXKI+NHthwfizhyvO7SSNKDMXXP9HDg+zYBUcP0CxHO5X6YIDAp7efHAu27j7EpIfSz6QGc/WBwaJiqM2E2GFe6zWMnx/isx0QUgaOcJVyoYuGOcBVp5979wF2eU0W6/fYM1oJiUd2S/Dlcz95Uxr2D3kKCjyAnTULHvcOQs04z5HSZyNhOm8T7bYwKScEP6nqIn18GwCMTt0zFZbpxxIOQiYXYpEiO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vl8PzzY4yJIleLdG+JS4VmMDwOy68uMID6LfcHDQYKr8z2maEbhtTz0CG2iQOHM5gp8Ti8cuUNQf17NTKg/Eg/S+zn4que5Vbh8Zi+TMU= 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. 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 ad3a0294a2ec..648fa695424b 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -1761,7 +1761,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) @@ -1783,24 +1783,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; } /*