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: 140064 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp772271vqi; Thu, 14 Sep 2023 20:11:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHWTCJbsGfkUPo8hLmc3wjzOz/Drbh1rOgxfZe+LonbaRv020A7mDT5Qacuj+SGE7G+RD53 X-Received: by 2002:a05:6a00:1141:b0:68f:c057:b567 with SMTP id b1-20020a056a00114100b0068fc057b567mr409217pfm.26.1694747511133; Thu, 14 Sep 2023 20:11:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694747511; cv=none; d=google.com; s=arc-20160816; b=bPbMjvkouz3KQ8pcDbx3XhE5kGLkYtyswfRQSJkbJBOfjIMUhJ0VHfWYIQ2k4Ge3rz /rcpYChgMjBNbD+58mFVtJebkHud6SdY7DYFfwX7evWvOHFu8IwQ6YsIzY/cCwLnP7O+ qrDfd1WUj+aM8joACbJd+vTOneMotlN87fjYUUYX4s46eSiy2aZOCRRvVBOo7AiZGtyi CoagiwA5jDWvASFYwEJrlDGhhd7CDgvTwuE7FIwcumUHvOlIBun8uj4SCb1y3yRE1c67 yavMOwmLFQksiBVNKuRI8IjthIe/hpNe7tesNvdW0PtuGWnBmZQALbZ3VojL3vFdIpk3 Z+Yw== 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 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id g14-20020a056a000b8e00b0068a4ba92eafsi2655926pfj.54.2023.09.14.20.11.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 20:11:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; 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 2620:137:e000::3:7 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 835D282CA0F6; Thu, 14 Sep 2023 19:53:35 -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 S231844AbjIOCxX (ORCPT + 33 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 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:35 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777071565983263586 X-GMAIL-MSGID: 1777071565983263586 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)