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: 137860 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ab0a:0:b0:3f2:4152:657d with SMTP id m10csp1597436vqo; Sun, 10 Sep 2023 06:51:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHZ+XOjLKxnNAUkENcqjAibO6GNYe6IoNPiXsggLIywHdxrBTmEISsbWg2MVsvKBUARNOfr X-Received: by 2002:a17:906:300f:b0:9a5:9305:8402 with SMTP id 15-20020a170906300f00b009a593058402mr7066318ejz.51.1694353888464; Sun, 10 Sep 2023 06:51:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694353888; cv=none; d=google.com; s=arc-20160816; b=zd5yJaXVPMMbwKgV3oZUXhc8UrC2DUPYfn8zwgrYF7g7XGyz31sBbV0qGbLlSyYQvI CAetZcqwrr0bblc/hql2tQrVr3qWkvT8J7jjWZlA+g96KgWpJwUtehjnqKp+X7aRlyf/ /pdHkkzybpBkAX+YnyPZkewNQ+P4i0nlk3qSNWoVScOLJ6rZnZSQoOO4b3mDBLOfERQj Yct6Fic62xLl7CCifYCFUuxai2IgzhtBXFGZPAZYrz1NC9K/0c9fxqny8fH+7kX0SMSl IVjlnAHp18higAUlqIlimLUa2ny5D31jlBK/geY97NmFB7TDnRa2KLxaJtHQ++Y7hALJ TVCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=I15fcCiftstjDJhtda4bP9yIA9qbFxpP8S+UhQRu3rE=; fh=vqNpWvtrgKyqgLywmXrl7l1d0QUXOIwW93A3X4awQbI=; b=mIhC2FD04kfW7JBDMzlZYJStbVLv2hl4iHFTDHMq1GlLV/ZEIoZO0yh1SWd11ToX8u r4CH8SjRV7HnP3ioa7MnYq8xbpKb6Fnremn52LWBv/UZmL6/JzJDcczNZd1Kbxm8iDUW FNptxbvtZAeZ3x9I/NROVFmp+/sQ8oma4uEr3hcAJSUs99w6/00hWns6LcfXyJP9CO1W V23ZDqwPZ8kj4oxvAG16E/pWA3AcQo18aZm1PoneDg6Q2NnU3i+UTYix9zSYtEUfJN8a VMwGMUdHNFXQxfhs3V/PmnfJ2iSHYeGv8AEdsnoFoBh1oaY1giWlxTx5TcjYaj4iBdSd z+Bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=Izsy8M9g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u1-20020a1709064ac100b0099e04cdb98dsi5127446ejt.310.2023.09.10.06.51.24; Sun, 10 Sep 2023 06:51:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=Izsy8M9g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244692AbjIIDhq (ORCPT + 11 others); Fri, 8 Sep 2023 23:37:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240919AbjIIDhd (ORCPT ); Fri, 8 Sep 2023 23:37:33 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 314591FEA for ; Fri, 8 Sep 2023 20:37:29 -0700 (PDT) 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 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-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776658822912526152 X-GMAIL-MSGID: 1776658822912526152 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;