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: 140043 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp765640vqi; Thu, 14 Sep 2023 19:53:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE1xgI4NmIQp9cRbccwyMxBd9dzIk25hPUwjzliOPOfJus7ZECz//vhUKE9JY15SfVe8Df/ X-Received: by 2002:a05:6a21:819e:b0:156:dc22:96a6 with SMTP id pd30-20020a056a21819e00b00156dc2296a6mr528668pzb.55.1694746426734; Thu, 14 Sep 2023 19:53:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694746426; cv=none; d=google.com; s=arc-20160816; b=IXkb0sJY0UoOAkhqcfYz+fay0NQIHghj5dry/Pozk3t9ZdcpaR0DhUEPkiV1AbeSPa hyVzZ2MX5shQDPxKP6DMCqYVV5TzCFBRrZKb/4vrIXAyZte1549AyzpJL1t0t9biTSUh TuxSxywZqV3p96Y1rfgPwlkLjxTvE3Lkmi2U+0W0jw3tp9gUPtwd+CCHtg85APxXMVKe Y1jY7AQihrPjcCgEUEOLTL5tgs3rukZLiGFcPgayCC0/oBMgCOi1gB24KXY+V8XQ/AhM wTpXsFvlQAdNX3IEFVwggin6g0HGIdGOTRdJw/+2tZrJqkYkFT5brsOMRoeZxu6IwJMK 3gRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5nv6ta+5+IPL0DQgGt4qp4kHWCSK8jkn9EGeLE0STJY=; fh=BzdeVYqZhG5iuwuKJRNLP969rvCput73lx0iwx2zu7A=; b=xzBpGtKQA2KBhhmgf9FaCFEvAb/36j9vzkExe1LZD7JzcInsdR6FqHfCgIWVgEigp8 HhTCSBVEbMUzh04QFQZk2xU4z2dhKKAB0D+eFUQNftE4xpOfcmQmskJd/qvr1MzQqKFn XfV2wEu5yOXD9XUALVfNm94cNk1tXRfLFWvUqGLVmcA4dc+w3ldtTTMi37fNdtxFrB5g msA6K7oDvw6z9d/dKOqDSfHIIYxqt9y7K+6DqmS0MYm0DhfrC8O5vLiLhfjat1BLdnu6 GtM99GSKevIh0NDS2GdYxm651+3TJI0dX2y/SqakivUVqESBFOFrU7SiyyQTucHCcdAQ 6ysg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="GgK6DIT/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id x7-20020a056a000bc700b0068e45c9c986si2436459pfu.136.2023.09.14.19.53.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 19:53:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="GgK6DIT/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id A06868313D02; Thu, 14 Sep 2023 19:53:44 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231808AbjIOCxb (ORCPT + 33 others); Thu, 14 Sep 2023 22:53:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231859AbjIOCxV (ORCPT ); Thu, 14 Sep 2023 22:53:21 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97669272C for ; Thu, 14 Sep 2023 19:53:12 -0700 (PDT) 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 14 Sep 2023 19:53:44 -0700 (PDT) X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777070429275153215 X-GMAIL-MSGID: 1777070429275153215 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;