From patchwork Sat Sep 9 03:37:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13377953 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 D019BEEB57F for ; Sat, 9 Sep 2023 03:37:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EAA236B0109; Fri, 8 Sep 2023 23:37:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E59336B010A; Fri, 8 Sep 2023 23:37:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CD40A6B010C; Fri, 8 Sep 2023 23:37:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id BAD9B6B0109 for ; Fri, 8 Sep 2023 23:37:35 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 94AD7C04D6 for ; Sat, 9 Sep 2023 03:37:35 +0000 (UTC) X-FDA: 81215649270.02.B5058C1 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf23.hostedemail.com (Postfix) with ESMTP id 7E36414000A for ; Sat, 9 Sep 2023 03:37:33 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Izsy8M9g; spf=pass (imf23.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=sj@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=1694230654; 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=I15fcCiftstjDJhtda4bP9yIA9qbFxpP8S+UhQRu3rE=; b=H6xzkZFstTpqwHT1nGaP5rwxCttvU/2TriIxwNNN0RHr7BKoqxT0iBArQ2QhOTHZi6xoZO GXlrZ6yvbRbdlgDd6GxEdE9sKf/bq4luHP8seClWN2ly1qq0fJlh0oDB0koX3TbW0I0ZJ2 XEOqgjZx4fIF7UFsf4nCTUoMswtNypA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1694230654; a=rsa-sha256; cv=none; b=Mbx2ajck9+tUEwFRT7gckEj0kr3fqRQ2MU4BpMnXzVqKNrY0Y30lN+aWs2fJDem7GLIsEH wU6UdouwKB1zmwoubptO1RGM9VruXT5sSRzkPD4O+OB7GZ4sCPLF5V3ELorUdDRK1xrsoT McBvo2nyDhBR7dHHLpXMmEo87Hi15Gg= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Izsy8M9g; spf=pass (imf23.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id AB27ACE1D52; Sat, 9 Sep 2023 03:37:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A803BC433CD; Sat, 9 Sep 2023 03:37:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694230649; bh=u4g+CGjCZbG2QHJKasID6b5E2s2G6qeOdsap6ruSGmY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Izsy8M9gmHRZoYcw3BIdjHqk4Bh4D39q8DOc/nlB1dcLYYvpMQGZxHev79ESz2uns WEu/9IXL70k9mccElhHgYBm8RqMZJk6rScKpW7vnlzL/IY3fsrVG5lAuul/mz7MdGn UJrGFRmo4XD9g1Q33/kCg0C+GCVOWZwGsjdlE5Q+MBBRu8xG/fnutSXgquG1SjGdnp b+iZW54q/5eZ9jpWecrLxzyz4UXNo3+AXEljpMjsI66zhNXb+aGUk22Q2BQx6qJJ/3 jT/ulxnTRocN/Vg5EAkvTeirS7OtTYYuLlQwTDc/RZrHcbr/aRpVaxBD2hrKfcwSJu Fp0dVQBatu+iw== From: SeongJae Park To: Cc: SeongJae Park , Andrew Morton , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [RFC 8/8] mm/damon/core: mark damon_moving_sum() as a static function Date: Sat, 9 Sep 2023 03:37:11 +0000 Message-Id: <20230909033711.55794-9-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230909033711.55794-1-sj@kernel.org> References: <20230909033711.55794-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 7E36414000A X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: zi1cgn6jxhmjj5d5pupt6e9qr574p8do X-HE-Tag: 1694230653-758802 X-HE-Meta: U2FsdGVkX1+9XDLSsx5bqhlKj0yWTOOYPFYL1vDBniB9WX7rlWvGqAjR4mIIiBAFW8liIBqBHoUvUGlQuEDIGVqzNTG1zARBSdrXLIP52dXnSzWlRqlhr2S0eX1BqiRhXZhoPxfXCVrQQqI8SAk0uWwgFxeKW2Vhp0RMxfhDs0ztiatMFFijTsgSUZJrryNYSX7lSTtBZ3ik/Se37cMW2mqFtw96cIctyxGrCLdgc3Ogh41zZxt5I4jIVrNnHawHLtonCfgCOfKyu0ib8v0opFCw+UZKCJyluY8VwpyyTln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ogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The function is used by only mm/damon/core.c. Mark it as a static function. Signed-off-by: SeongJae Park --- include/linux/damon.h | 2 -- mm/damon/core.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/include/linux/damon.h b/include/linux/damon.h index 0fe13482df63..491fdd3e4c76 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -632,8 +632,6 @@ void damon_add_region(struct damon_region *r, struct damon_target *t); void damon_destroy_region(struct damon_region *r, struct damon_target *t); int damon_set_regions(struct damon_target *t, struct damon_addr_range *ranges, unsigned int nr_ranges); -unsigned int damon_moving_sum(unsigned int mvsum, unsigned int nomvsum, - unsigned int len_window, unsigned int new_value); void damon_update_region_access_rate(struct damon_region *r, bool accessed, struct damon_attrs *attrs); diff --git a/mm/damon/core.c b/mm/damon/core.c index 1ba7c4669263..83b0cd329e84 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -1627,7 +1627,7 @@ int damon_set_region_biggest_system_ram_default(struct damon_target *t, * * Return: Pseudo-moving average after getting the @new_value. */ -unsigned int damon_moving_sum(unsigned int mvsum, unsigned int nomvsum, +static unsigned int damon_moving_sum(unsigned int mvsum, unsigned int nomvsum, unsigned int len_window, unsigned int new_value) { return mvsum - nomvsum / len_window + new_value;