Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp1210842rdb; Sat, 9 Sep 2023 14:16:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH6piWIUzseOIRy2g/ZhROZVvQooMKvytLSVQ+qBVVySwhzOngQ4Qo3vKNOgPx71IEFkqFm X-Received: by 2002:a17:902:9b89:b0:1bb:ed01:2d03 with SMTP id y9-20020a1709029b8900b001bbed012d03mr5959685plp.50.1694294214334; Sat, 09 Sep 2023 14:16:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694294214; cv=none; d=google.com; s=arc-20160816; b=dTiCZD++VE9+RTIPXIBcM3T8FYUrbUHrImaDCMesamG98wl7nlO3wRiHEcc2uNWB25 rBr6/l2uQDNll0+9EbUSiv4njRuCkPGVt5nUfM6BhSldQwSl3ZWEijvNNZPI9ztsxVw/ 04n16mmubBjmsuqHEssFDwPrzB+aBesCbgs57z9bSC5/hj33iXNRkDEcfS+EuCwXXsof i7e1Dc90XnYYVSx83zCpj8h7gI0wRScYIcn0a1lXlv8zvcfPWVYjcUW4ZWXEBOpSVZ9L 00YFGhQGyM27weadSpcw+X/grcXT9DFuVPJcQHB6lbS4HrBqJ+DgzPAWllsy3LpN0oK2 NOhw== 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=t0/NgnLtC+2FcxnOrp3sy4dMgy71ergshlIM2wzPpzk=; fh=vqNpWvtrgKyqgLywmXrl7l1d0QUXOIwW93A3X4awQbI=; b=rP4WBjg4dkw6lC9aKaSqhCME4bMU4AvqMzbUKdHIexvs/wsOKDIyPfVk4zV3unCDDb 3jLc+JpT2Iczrxs4w7GHVcxQEtFaINHIKu1B697T5E70bb2RYVvAlawl7y90jVR1tVZ4 OCNsUoDFRPzDw4/8NxlGvbQOjXLXG3wkXvWnATnuqeF1FpKTpFxZ3Soe5vlM+ttU4eH8 kBQ6zaWKwPs7xioQWVXYE+oT5XHWBFLd7OKrqJjlv2DiYaEZKVuw1n9QyBwlpWhcqvBn DM1/49m2aUqg4pZT42RusFGxRfGwD3Xgs+ywZkYRgA9xpR2MsIwNeDZzzxCVuQYtyhK4 miuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=M330diVc; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l1-20020a170902f68100b001b82da85c5asi3938476plg.336.2023.09.09.14.16.40; Sat, 09 Sep 2023 14:16:54 -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=M330diVc; 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 S237458AbjIIDhn (ORCPT + 99 others); Fri, 8 Sep 2023 23:37:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239970AbjIIDhc (ORCPT ); Fri, 8 Sep 2023 23:37:32 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 970491FE9 for ; Fri, 8 Sep 2023 20:37:28 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1DD2AC433CC; 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=1694230648; bh=T2wTbeMBvGg1oZ8nMQI/oEwy81mbG221hI8+18jJewo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M330diVcv9Kv8EFldGI7s8B5vCDzjiNiU4H2nlTH8r7+IiEwi5kUPhPW/GuRSKP5x v3IyZOtLRDLVfZ2WPK8Zkz9IrzCPN0ZTJ9nO4TsUmxF7xs9lVlqAAkfd8jXu6wYtVQ 91yY3g+LT32JKjm2Xx94XGmfyFt0XxQ+YkNTnDOHU8NosYA/liDzlDbrc+3MfWXejp IjwVRkebxbYSQ9sVjy87LpHF4LPtnNfK3UypHePRMR6wW33HnXGYmLjfFlhsTo67gU 8tbGUIUCWUodMZey4IKMSr8S4w70YMr164pmXvOXKWrnX1zKb/ZXBBK6k538Mu2WF8 ZZvnEWTpJZY6A== From: SeongJae Park Cc: SeongJae Park , Andrew Morton , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [RFC 7/8] mm/damon/core: skip updating nr_accesses_bp for each aggregation interval Date: Sat, 9 Sep 2023 03:37:10 +0000 Message-Id: <20230909033711.55794-8-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 Content-Transfer-Encoding: 8bit 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 damon_merge_regions_of(), which is called for each aggregation interval, updates nr_accesses_bp to nr_accesses * 10000. However, nr_accesses_bp is updated for each sampling interval via damon_moving_sum() using the aggregation interval as the moving time window. And by the definition of the algorithm, the value becomes same to discrete-window based sum for each time window-aligned time. Hence, nr_accesses_bp will be same to nr_accesses * 10000 for each aggregation interval without explicit update. Remove the unnecessary update of nr_accesses_bp in damon_merge_regions_of(). Signed-off-by: SeongJae Park --- mm/damon/core.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/damon/core.c b/mm/damon/core.c index c813407c09b4..1ba7c4669263 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -1182,8 +1182,6 @@ static void damon_merge_regions_of(struct damon_target *t, unsigned int thres, else r->age++; - r->nr_accesses_bp = r->nr_accesses * 10000; - if (prev && prev->ar.end == r->ar.start && abs(prev->nr_accesses - r->nr_accesses) <= thres && damon_sz_region(prev) + damon_sz_region(r) <= sz_limit) -- 2.25.1