From nobody Fri Dec 19 03:41:44 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99224EEB57F for ; Sat, 9 Sep 2023 03:37:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243009AbjIIDhp (ORCPT ); Fri, 8 Sep 2023 23:37:45 -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: quoted-printable To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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_targe= t *t, unsigned int thres, else r->age++; =20 - r->nr_accesses_bp =3D r->nr_accesses * 10000; - if (prev && prev->ar.end =3D=3D r->ar.start && abs(prev->nr_accesses - r->nr_accesses) <=3D thres && damon_sz_region(prev) + damon_sz_region(r) <=3D sz_limit) --=20 2.25.1