Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4961570rdb; Fri, 15 Sep 2023 19:24:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGQHPOmO4JDaYCzf3V9oC35qi83zvjdhzPZKOvtVMdpRS4nff4NCHAzKqsWroslIQtZZKNP X-Received: by 2002:a05:6a00:1f0b:b0:68f:c9f6:f366 with SMTP id be11-20020a056a001f0b00b0068fc9f6f366mr3807825pfb.0.1694831074647; Fri, 15 Sep 2023 19:24:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694831074; cv=none; d=google.com; s=arc-20160816; b=smhmoazVqNd6/dCUTavN1w22d0SUOGFk0jAYDPDv4Uzn9xsu+zuy78jVdgQfs/p3DU /u37K9at3DL8GFlMKck+5yuwGKkwWV5Cac6nZdwpNi2C3kww3SN9ndRr4YCtNx9tzJJF aB9Dz4mXFiQ6AKualRy1az/aHOtr8UUEVhG8YjL9S1bLignk4i6NlRR/7T5kHMqPVqWw WdLuMYHpSsK+vysOIERJ1kDFX91pWFO0SxluBANJkowm7rdlD2KPT9qbRsot/KQ7M7N7 4Np1efmABDyrvyzF78UxciDxdvtr2ll4N5hhoCE9m91gB5hRZefzVbqynTQjvj2y0adQ 12MA== 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=mxS0NDdtbPRnU18dk9+OTOoH37taYp/+bQDsW+ALhsc=; fh=BzdeVYqZhG5iuwuKJRNLP969rvCput73lx0iwx2zu7A=; b=pmdmmOk9fCl0hhDlNfjRtRTwSkZ8g4zPtt9W0j6lbQmBgGa3FnM0txMLm/K/vOvjIM 2CeqEBhfLFeave71dw2tVIKQWvPerdSIOoWPRy6Lj7yAoSkZgcVGUk6IJ1U2SYRrh8ZN UvI0mBmWZt466oY1hqUXkSeN7xlnpCED0DYZQUb8J0ZK9FYfAih6I7EFua+HZ9rHjb2U cOkTM/QcCe06Ig6JFU7Y9FIldFZIjEKYb2v03hDzcbhkbc5DO2GqauMbwiUyjIazhE3K UPKDMA6+KgqkyE3jH+VLIjH2idVqoF92T4+EZGWsU9Vo4dGWFwXlFS7QVwYJBc+OGdWS vxtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DE5n19QT; 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 Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id s128-20020a637786000000b0057828b85afdsi1612146pgc.795.2023.09.15.19.24.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 19:24:34 -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=DE5n19QT; 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 690A3825FDC3; Fri, 15 Sep 2023 19:10:57 -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 S238294AbjIPCKW (ORCPT + 99 others); Fri, 15 Sep 2023 22:10:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235752AbjIPCKB (ORCPT ); Fri, 15 Sep 2023 22:10:01 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 867D6173C for ; Fri, 15 Sep 2023 19:09:56 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC149C433C8; Sat, 16 Sep 2023 02:09:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694830196; bh=VEo1bT4L3oASolFpAiFgoKtkxwTv3u9FxZ+yfBw7tjQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DE5n19QTrLA/q3MCbj6txVWl1uVLgvfvimtQFgvcddmHPnYMGBO3fFDzwOKCAE1Ea 6ZYLcxHkm5CTWFprrqRjF2KtaYm2Pz1lRDiwdDYTuq77AJA0RSUh5o65EYEXrOnEHs xWMKylLYUB2wBv7QR/yROAzDf7cNTsquwx29G72dwKWAZ+EmwIigZOPRJm/YCHaQd8 oGtGCMonOLobfZnVSyKN0ZWlbECSyGnvfq2vefdC/SACWvKlxDcHJ9gAJk10AUBeAe OUhBoRM9HauQyDIauN7P46WxsCKPvr3KFTi/4wXKmwRabKlNI1DRkIECckLti/Mt8P t2+3IdJ/6uTGA== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/9] mm/damon/core: make DAMOS uses nr_accesses_bp instead of nr_accesses Date: Sat, 16 Sep 2023 02:09:37 +0000 Message-Id: <20230916020945.47296-2-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230916020945.47296-1-sj@kernel.org> References: <20230916020945.47296-1-sj@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,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 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]); Fri, 15 Sep 2023 19:10:57 -0700 (PDT) DAMON provides nr_accesses_bp, which becomes same to nr_accesses * 10000 for every aggregation interval, but updated every sampling interval with a reasonable accuracy. Since DAMON-based operation schemes are applied in every aggregation interval using nr_accesses, using nr_accesses_bp instead will make no difference to users. Meanwhile, it allows DAMOS to apply the schemes in a time interval that less than the aggregation interval. It could be useful and more flexible for some cases. Do it. Signed-off-by: SeongJae Park --- mm/damon/core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/damon/core.c b/mm/damon/core.c index b15cf47d2d29..79fef5145a4b 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -770,12 +770,13 @@ static void damon_split_region_at(struct damon_target *t, static bool __damos_valid_target(struct damon_region *r, struct damos *s) { unsigned long sz; + unsigned int nr_accesses = r->nr_accesses_bp / 10000; sz = damon_sz_region(r); return s->pattern.min_sz_region <= sz && sz <= s->pattern.max_sz_region && - s->pattern.min_nr_accesses <= r->nr_accesses && - r->nr_accesses <= s->pattern.max_nr_accesses && + s->pattern.min_nr_accesses <= nr_accesses && + nr_accesses <= s->pattern.max_nr_accesses && s->pattern.min_age_region <= r->age && r->age <= s->pattern.max_age_region; } -- 2.25.1