Message ID | 20230916020945.47296-2-sj@kernel.org (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 9E0C5CD37B0 for <linux-mm@archiver.kernel.org>; Sat, 16 Sep 2023 02:10:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 04EF96B0409; Fri, 15 Sep 2023 22:10:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F41416B040A; Fri, 15 Sep 2023 22:09:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E30106B040B; Fri, 15 Sep 2023 22:09:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id D10356B0409 for <linux-mm@kvack.org>; Fri, 15 Sep 2023 22:09:59 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 9BFF01407A0 for <linux-mm@kvack.org>; Sat, 16 Sep 2023 02:09:59 +0000 (UTC) X-FDA: 81240830118.24.7D3FC51 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf13.hostedemail.com (Postfix) with ESMTP id DDE6620020 for <linux-mm@kvack.org>; Sat, 16 Sep 2023 02:09:57 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=DE5n19QT; spf=pass (imf13.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1694830198; a=rsa-sha256; cv=none; b=umIqieNSqNCu/ECsuiwEWkwnZouZLE6tPhLaerca2Fl9oymor57cDN1u+AnF9K8hoxHetX sVLT5Swqgjsq9YVkjK5otEbERGF7VvqMc6taCNLZn/0Cy8hJHzCTfLRmHXnjzGmaFjaabJ nxOIS+OVFuU3Vp8Bfr1ogIVArog2IwE= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=DE5n19QT; spf=pass (imf13.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1694830198; 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=mxS0NDdtbPRnU18dk9+OTOoH37taYp/+bQDsW+ALhsc=; b=7RhGDvp5QroemM56NKX5EF+9VJpi3LUgoAjBUxsOA/bkE+l0vJOoTSZT28QqX+Zvwz5/eJ nxbqEd5lUAA4jlmdOwed0xrmIyZVBAAUCMoSzFooTZvFHHLG5eQfuZ3RIzwULbLJekEkFn YfBOQ0az8gMAsyd/cfUC5XsSwMAStZ8= 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 dfw.source.kernel.org (Postfix) with ESMTPS id E8B4562180; Sat, 16 Sep 2023 02:09:56 +0000 (UTC) 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 <sj@kernel.org> To: Andrew Morton <akpm@linux-foundation.org> Cc: SeongJae Park <sj@kernel.org>, 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-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: DDE6620020 X-Stat-Signature: ooer7zaohmwq67ss5jw3o7yc3ux5oj6n X-Rspam-User: X-HE-Tag: 1694830197-84000 X-HE-Meta: U2FsdGVkX1+2+Q2lj072SpqXGu5CXxiAPDmTd4YYmPw3qVZzhf37MuQL5HkeEGLc75IrBHUuUvxAb8okJLD93s9pZ0ue4twE4j+lXYyDP9MzFTZnK98ZvTbRDjmL6hgluhVbHXXqOf6ABO7dSCEf8KPdXG9C5FxiVtLUPCgtfqFb+/LaM7XZUY2/djyW1eOtwVmLgMaC+FoR0z26p2prdUHz2apbGKjTyKWF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OBlns1NOtmkzzT0EiGpmCUa6oB0t3xW1+9kFIXuwau7uAa51GJXzetFQHSKMLyn3S8ti4u X-Bogosity: 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: <linux-mm.kvack.org> |
Series |
mm/damon: implement DAMOS apply intervals
|
expand
|
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; }
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 <sj@kernel.org> --- mm/damon/core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)