From patchwork Fri Sep 15 02:52:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13386319 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 42B8FEDE989 for ; Fri, 15 Sep 2023 02:53:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E01BE6B0314; Thu, 14 Sep 2023 22:53:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DB1C96B0316; Thu, 14 Sep 2023 22:53:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C4FA36B0317; Thu, 14 Sep 2023 22:53:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id AD7B46B0314 for ; Thu, 14 Sep 2023 22:53:15 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 817A516070F for ; Fri, 15 Sep 2023 02:53:15 +0000 (UTC) X-FDA: 81237310350.18.E5CA252 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf13.hostedemail.com (Postfix) with ESMTP id BF10120024 for ; Fri, 15 Sep 2023 02:53:13 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="GgK6DIT/"; spf=pass (imf13.hostedemail.com: domain of sj@kernel.org designates 145.40.68.75 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=1694746393; 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=5nv6ta+5+IPL0DQgGt4qp4kHWCSK8jkn9EGeLE0STJY=; b=6hbnw4kia3WwsOZK4uUHQNl6c3wHdpg9Dz5yikNGvQ8umy0GkBHMIFBtwp1GJG/W5BGsSg axSaOLElgeASIWFK1V1Tugc/xMzzFRSoBNnn2mIU7L3XY9TMPtSAMYX125mHS6oYzG+w8O 2icS8gXv3u6ZNad234VuuGoiDO5amSE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1694746393; a=rsa-sha256; cv=none; b=4WRUbQ4qrljLtzR8qyw6sH1MDTf7Nk4SfXOzFChwqFPytsXH64bdjsViiwezOB6eyhQxI7 LeKgk3Wz7IMAqx8OpEYor0pLkeTu04vypV8JUMgxfL1m3i5ilrzsPbtKIs28LeCJX4ZXhL kpQ73SoymSxsJ9YMCrtHqBIgLD2cdOg= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="GgK6DIT/"; spf=pass (imf13.hostedemail.com: domain of sj@kernel.org designates 145.40.68.75 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 ams.source.kernel.org (Postfix) with ESMTPS id 893DFB82B87; Fri, 15 Sep 2023 02:53:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CBC4AC43391; Fri, 15 Sep 2023 02:53:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694746392; bh=RYtjac5KN7rdOK43JC6LnDJ12z7FKzya3dCtCsi8Y0g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GgK6DIT/rJEDrFaud01fxNb9X9ulgXc+DHEZpEYNHpQBHaq6gCDhkm5CNvhTtn3nY UbHvgHF8XfDy9iIQIOfKt9G99WrG6wz1rwaSpybz3ut17/5oFJLGNwPwq1dcXrWKXw 07Q++0DI8CyHA7uWn8iE/iur/xjP7LIoSyXDJG46430Bw910FuSgyA45Gs5G4frZcV Ta3OJrD342CslwNXGEcjPCByNlfc4PH3dXgyopGgHEaLztbBRCa9GDKaRR+CsuB4V7 OzStFx2T2Mv1/CPjbye7T09snFeyN6HXv+p2/gZ5lgLUNFJItBRAK+qhQ0xw8XEGD0 hlGk0P+/2eBlQ== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 8/8] mm/damon/core: mark damon_moving_sum() as a static function Date: Fri, 15 Sep 2023 02:52:51 +0000 Message-Id: <20230915025251.72816-9-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230915025251.72816-1-sj@kernel.org> References: <20230915025251.72816-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: BF10120024 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: o1acy8eij5wus9hi4chnpoxy1w4dkk6x X-HE-Tag: 1694746393-29745 X-HE-Meta: U2FsdGVkX1+TyeteQ5Ys7+wKurFnYfWpyWPJ1p1QOwT7TPvtNgHUkZY9aXQXDc6ET2ziOUsFPexeEIuwqTamZwuilQHgdVd1neE4mz8/gSzWl6dPTl9RPq2WIDTqFcn9hXZOZE81U96Pa36SFLuYWFeTMOxsqfPbZ46Bgj0AAl5G6XJcFjB9Nrh8DO4AnkxRpmtO+g1XCFpZKrA0J8RL/mpm97THqJZ6KfxE8aptnjAD3wTtDqRA6HRjaWOq8iauPSTP+FvcZzFreSnQoqYatYH2G23aGDyzvtRpAzty7S6I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I5mroM 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: 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 45cc108c0fe1..b15cf47d2d29 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -1587,7 +1587,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;