From patchwork Fri Sep 15 02:52:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13386320 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44D20EE0215 for ; Fri, 15 Sep 2023 02:53:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 661116B0316; Thu, 14 Sep 2023 22:53:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 60D716B0318; Thu, 14 Sep 2023 22:53:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4AFE46B0319; Thu, 14 Sep 2023 22:53:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id C57456B0316 for ; Thu, 14 Sep 2023 22:53:16 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 9F9C5160164 for ; Fri, 15 Sep 2023 02:53:16 +0000 (UTC) X-FDA: 81237310392.13.345E4EA Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf07.hostedemail.com (Postfix) with ESMTP id A03764000B for ; Fri, 15 Sep 2023 02:53:14 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=eSK3bW5S; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf07.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1694746395; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=35ICP7tkeKkUG2m8I3W+MDZQL7PDEnmFeI1sDSKJbJU=; b=c2oAk9l0PPNr2pNGl9o3nK6AEYboNxx9q5S/pFQYMR/l7VzifQF+6UXrmgbC7WL6c4LiUn xjzjkDzuYGhjxM5drpxoLEE9lxCNZF+wj0U4yt7w+jvMetsBvi52dAgexxGLJ97PfDAKmF KipNU0RKUACFB5kIrlTXExePfM8fQVw= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=eSK3bW5S; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf07.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1694746395; a=rsa-sha256; cv=none; b=VQQDUPXkkEQ3oz1xkDn77wqeE2DAyyIK42ZblJOGj156TbTlKyWjPcWb6GbBXuezMvcq3Q ajbpKXWwrqOhgVsWcd+dAY6JgRtFtkzaRcnTk0d1+QxiOgWeSuonwcYuZExkTTDXztgW2E gQz1GcsjaeH1HozPQrWy8KvCKlLB8CU= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 97AA0CE298D; Fri, 15 Sep 2023 02:53:11 +0000 (UTC) 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 X-Rspam-User: X-Stat-Signature: x9gqrxd5bin88myqbka13hwghtc17pjp X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: A03764000B X-HE-Tag: 1694746394-812398 X-HE-Meta: U2FsdGVkX18n5Z4lMSlPkH8dvamfrZtAGn8Y3UVT3HMYxAruV/dcR1WyjMjPJ6p7cRzilD3buETY1agLe8lJp9m+VsnBYYl1RtbpwtcuqOT5RgIkI/gXr2zPOE38Ho7oFnZ1OOzxwc8wWI0LBASTWhCHGUbwmvzhaDg0tX8Umc0gfervpiExHWZUsq8+Jy6bzjD6wIZEA+WxIzPt0h3U0dKmVlDHMoWrZDPo7whauFMVJGdWbG3Y31e1QmO8YXVktNX9aqStG3ApqtVAMo/OSVLKfnCxAtXdRDVJA+h3Xx98sv/jRr7iC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Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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)