Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2758172lqp; Mon, 25 Mar 2024 08:26:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXU554/MOrjpBVVQ/+G6MVzn5VKcCRr82k/D3hcnTmy/eIClKTZsnVV0nSqqNT8T3YOZLwMOZuF8909QpW7DlWEis1N0Sdas76LV+lhwg== X-Google-Smtp-Source: AGHT+IGEhjnEWYJR4WtRiNzAVSZqqmV/TnCUpDRH+jRKCpdUcJ+xOcKDa6xPZPaq+arJiLIKafmz X-Received: by 2002:a05:620a:1441:b0:789:e842:a04e with SMTP id i1-20020a05620a144100b00789e842a04emr6995815qkl.39.1711380385935; Mon, 25 Mar 2024 08:26:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711380385; cv=pass; d=google.com; s=arc-20160816; b=w51ugineI2AaXcvcIL4p4ycXSPU2QOA2X1tWXl48TBeAOF8sG354qx+Jjv8IZTgaco 6REiNRO3iSBycAqPwnQPz3lWKCpg2+gKAcA/Rla7AeRrspEtmpDXgafz3mMPpCmZFKYE ZkGanm4ESn36JDWpNoSU3J07DIHrMpffDPtu4TC8HkFxLL5MdnG3NBtOW3xebNamglJY TzzFwy97awExj9K6uWGzvVBi4wnVDI1ozaPwsxtVvlRnU8lQ3WSl+3ab0UIdwFmRCtOF yY4c/IaEQ1Y5itce0uHJXOi2E5sRaLpP3qkkoenae8OCUlaUt12+yN0sXFrKiMMo9SQj ClYA== 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=Su+w/May3HQEw0sTqjdP5gpPsA6SjVZVsA3paXcbads=; fh=82Tkto9wLAThGWFPjMOHQAMNM/SHGFFIudThbRSmfJc=; b=uVBVlig9DqJtV+QSyZ12RiHyLTQWCqU2jC3FezmF1zddy6V7bOymbCf4AcRWstYBE1 2+60agqokT0Kj7JSgfiK64eU7JXJY70HLK0V0QoeUL/ztDZ28mHBwDAkHdzzY0hzMtud zisOtuq9b9jmOPn9LYXqkeSuJljvy6GFBUobYyaEDcpJ/9JFTo4BLgH3GLJQPigs6Heh AeA+rptgOuro1F7LtTtJg/6H1B+jD9Htogr/sDPfcXsPIBksIrA6oV+pAEZxaySBmrqG hbOpmS0uxrH8JL/cL/7/8o5rwg69OJXM33htUGTVFBKvi7hs3SmOgBUJ20SfFloMXN5k uxlA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Rff8wy/g"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-117046-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117046-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id wl22-20020a05620a57d600b0078a4fe9e84asi3824598qkn.758.2024.03.25.08.26.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 08:26:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-117046-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Rff8wy/g"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-117046-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117046-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id A22291C37BBE for ; Mon, 25 Mar 2024 15:26:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AF257139CF8; Mon, 25 Mar 2024 12:46:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Rff8wy/g" 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 D8D5D15F411 for ; Mon, 25 Mar 2024 12:46:19 +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=1711370779; cv=none; b=XlPcehJNeiOgXPfSpTsoWiVNS1KFx9Uy6YIyuSV7YBURGG75nog5FNnsysOPOsJ1lTDuFEUV3VMd4E5+UwCo8VqzXtvLyXa+FOIFqbEJGVb9CRhaxYF/07iwemJsFgw+h1FBTZHDjxbf92+dRvuD6VzBc3i9Jj6Fs3XPiEE0MG8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711370779; c=relaxed/simple; bh=arZB3IpTCMJ2LTtZkVucxq3hez+AmaxlVxPKhMFKVEk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=M3QV3oP6++iGHAatS3ltGTJOAgpI6Kocc9v7RfAIEBTAFdVsK5c08FOvr9SY7siP1lL3I2dHIJAOOZtj9VnVaTeFPOAFZbrah+DH/87jiBi+kEsoxcU11++TshJdlwNV88SrHq6tqwIIn8yNU1MTp2+/lLB9arZP6bTIaf2HneE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Rff8wy/g; arc=none smtp.client-ip=10.30.226.201 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> 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 | 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; -- 2.43.0