Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4311608rdb; Thu, 14 Sep 2023 20:11:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGYKDveWRvcJ3vy4ziRrLIZC9KMFQHQM4zknZ6FMfcY28ywCtztK6jSejPosSbodJQvxoEz X-Received: by 2002:a05:6a00:cd1:b0:68a:4261:ab7f with SMTP id b17-20020a056a000cd100b0068a4261ab7fmr496232pfv.31.1694747507147; Thu, 14 Sep 2023 20:11:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694747507; cv=none; d=google.com; s=arc-20160816; b=SprgRq1UWdxMduUXaVZcOM7tFxjm2Muj/tCi+K91sveFkBu6rHceglEoCpoickQcGr zlNak054dIx1buBweQvN1iuejl6ysp20o05ZC+iUsXMzb9Gi1fBF/2lEZ+WE3NAax1xu 0SGwHhbhFiQfzpd9rEE9spcX7zRotvocSG8ZJgwwSDZasj/MpHZG+jjQeXgjd1XXn4up cg9PTH5OVvRm9g1DJ0Vdi4lTeR1bs5QJVQF60Dlq/U8xHEFZ1x35fjRT7jkZ0mOl8CrU NdnFjbM3CrIXz0jt28KVSYxRbbtQ8MEQHXdu7XsjB2TpSMMkKS7Fuq73PmpehP7O+PY7 4KGQ== 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=35ICP7tkeKkUG2m8I3W+MDZQL7PDEnmFeI1sDSKJbJU=; fh=BzdeVYqZhG5iuwuKJRNLP969rvCput73lx0iwx2zu7A=; b=OGLOJhihNXTm7RAGoNqPY3yfKcUPk77YHqSOzFHaacJy65BA44Z6dezmPa2joP55gJ GanBvfEpWLXxLCXZYlNxf7z118oZVWLkqQO1aviYk+XODexSEn4u8BBqBqcZ4sfR9pwv 6bGSfOkLrqzUCk3HzA2njHXN6qsz+Akp/GAF0du4ETmX/qfs5o/lrmcvTm/u2azYcjSy cqxSzyoBvI3hVoWYer7ADBBxd4j/H8EdndNoJ952/yO0yb+6pgIKGp1Kcebu8JDVY3P0 TRazuLjRMbhF93HZVXDPVySJF2FRmisRzRIcuN/0eCyUxQyzj1xgAM0UTFD6q1r9ClyC j8oA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eSK3bW5S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id bz8-20020a056a02060800b00577581963cdsi2825605pgb.252.2023.09.14.20.11.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 20:11:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eSK3bW5S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 7D6B482E3C5F; Thu, 14 Sep 2023 19:53:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231836AbjIOCxX (ORCPT + 99 others); Thu, 14 Sep 2023 22:53:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231758AbjIOCxU (ORCPT ); Thu, 14 Sep 2023 22:53:20 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 447BB2719 for ; Thu, 14 Sep 2023 19:53:11 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 755C8C433C9; Fri, 15 Sep 2023 02:53:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694746390; bh=54IK7cTm7KTNNX3XLRdWLVNJIup7inyJ/KiBfKYDcxs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eSK3bW5SwDXeS5zPCPPJiBwfd5vAIC7cx1I5DGDc3g1gvuXMCm8OZyYZaFTizCXr6 IGsoW8btGA90xigquM8091rNDyfmkhLNZwW7AIw8V9/opp1tvo1+424tjJaU6cby3j I/vcCzrwXGjBievjJ4k0LmkDlgt7Vpsff/hAU6iCuuvjFBQdjenQIAcfFr6mVvqAxE lvVQoEfYtTh4DFK+Os4lxuxXzBf8ovK+gvvU36ZpNYmDj0Q6OOWQtg+hcgCSutY3O4 y0w09Gspx4AymqefNtFvvOVgLXTTfoD0VfrvZtP6/fxVMSrz1FavT9eJGsqjrrSzLS oT47TwypudG+g== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 7/8] mm/damon/core: skip updating nr_accesses_bp for each aggregation interval Date: Fri, 15 Sep 2023 02:52:50 +0000 Message-Id: <20230915025251.72816-8-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 Content-Transfer-Encoding: 8bit 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 (snail.vger.email [0.0.0.0]); Thu, 14 Sep 2023 19:53:31 -0700 (PDT) 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 29ee1fc18393..45cc108c0fe1 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -1141,8 +1141,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