Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2664822rdb; Mon, 5 Feb 2024 13:42:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IF6l3b1udQdbIH4ugYnH4V17+/sq1vBrm3c7qwIWoKagqB4N3dNIPPEggOPMeCcuHHMfMcX X-Received: by 2002:a67:be08:0:b0:46d:3345:86eb with SMTP id x8-20020a67be08000000b0046d334586ebmr1307616vsq.8.1707169360307; Mon, 05 Feb 2024 13:42:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707169360; cv=pass; d=google.com; s=arc-20160816; b=wNFWwHsr9P90qXqB/vdZPgejz3GlKBNq8b32MgktEF/bHb7aAmgfBiZjXrJLB/sT4D fojk56yqRiSt3D4y/0lzCxN+tKkjFCMJqg7IrBJK30JOpvsp77s1JWT2VhJQtNKB/qE9 nlm7pRDIBhaPQUn9h3eMIWDooNJwH1pKY04TDu+rw3yT/iz8fR2nbYb/y9uRpeUgm435 MwUyKYyOS+BQkixMHaeqUKyj7aZQbONrjfTL13DFvWbJH35tIrdPxTVeYsQWl8u1khbM kOKZa9x/XvD0kQ2LDbUP0vouheHkA2KxJFM5KunC1jP6v8mwDJIqGPlxWgoFAhPM9XFY 3mGQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=d2qMT3u35mglUa4ImVfxY4C0ppBPUYOL8ACWhlAI1UY=; fh=Lw0M2i4TOtpnZVpniVoPCwuI636UPJRLfHWW3lbJkBo=; b=FZnUAJaUJAiwuNibrve2UwYREbcf+FVSMckX8sTXyVUbfa60cWKnXo98r98ooIcNS+ dHTMOSmlxS2EEm5nWiImS2xfDRU4yC0Suzhq6weXtEUzeWxDmjCGxGQRiXEaBOPvKtjl UmGtMEfFPGap5Ak1t8kC7afrknFzutZiat6ZLjlmvjAR/qW2UugdJ4rPTRyNlarm/SwF MASElE214spWGyT6ff3pTuPrND3CqTdeZmDB6ug7TLZC7Xwjq2UBR8Qw2Eatdx20tmWW Qaj5fTdugosUduS8xg9eyKTgZO+HwfA3eIHiVSo+KkKdOklerQnrtUpzVqrtxzZJyWdF jHAg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=txhdvRjN; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-53898-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-53898-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCWVfwFGfQTKQqxG4S5kwWaJlayb4Y2PIJ175x+waRcMccZOMY30dEnOK+8m6JXi+ahu4AHod/JoRfuZpzEAO6QyFW2OhZC3pWW7dezY2Q== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id a16-20020a0ce910000000b0067f5182055esi857420qvo.24.2024.02.05.13.42.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 13:42:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-53898-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=txhdvRjN; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-53898-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-53898-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 09FBD1C27B1A for ; Mon, 5 Feb 2024 21:42:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C49B912F39E; Mon, 5 Feb 2024 20:11:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="txhdvRjN" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EAD0E12F388; Mon, 5 Feb 2024 20:11:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707163872; cv=none; b=SSCLjcGn888PVMQJZX1MYMA0kMXid3nKffC8nkx90KLOAr/NM/kT9TXYH9Bwt89jCGFuRWPJnaxKbB5vvBI65AH9FpqZSHfXP45t27jRraIckWfNpsBDEN2bE4Ssyjxf+wqAdG8pihOkyW9N2gXdn8hdFpLHrXuEwH6uuuegtI4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707163872; c=relaxed/simple; bh=5A3KTajyzlfiyqCx6ogaKRTMf5L1vQAHm6WF8BBbYi4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=etFxDB1iCiOu8bcOSuOyGlL4GHUrHNDOFU/LXTiFHeYUBDAVRNFgWVM/B6hWH/ciM+cxue37IW+vD58TvQRmn7cbS9HDl9SZvULd/2MF5TZshKPjY9Zvlwk0OgGAsVfcCuqj6Rpd8H+YNGSwrRv9zhqLr4+xkGrOMi4JGZ6l94k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=txhdvRjN; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09C3AC433F1; Mon, 5 Feb 2024 20:11:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707163871; bh=5A3KTajyzlfiyqCx6ogaKRTMf5L1vQAHm6WF8BBbYi4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=txhdvRjNQDUnze0TucLwhHlfWSx5DElOfsPrV5PZgEMf2b7PGJ/Xh1MSSnX2klFqg BJtBpFfMuP8EskcGjS53a8adKDToULjwu8IWUKEootYIgDe90zxJSWYtoiKMgAlNgV sf4uFBsPQnQRCMpTBuXqi5KG1jTujQMP5ySigq26P1HBCG/P9KetItERYRdCExTc/g CbvEx/upsHlR1l71/7Md1L4+looSE206zPMzewBRcz+WNTElEOcVuvbfyI5KQ+WO9l CmoXpwmxAqZD8THlalIxap/J8gMrw/dGEzCj4QjWoE32UuRWd08myV19m+eA8it2IA sq+FGC6v342Qg== From: SeongJae Park To: SeongJae Park Cc: Andrew Morton , damon@lists.linux.dev, linux-mm@kvack.org, stable@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/damon/core: check apply interval in Date: Mon, 5 Feb 2024 12:11:09 -0800 Message-Id: <20240205201109.88463-1-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240204204946.87265-1-sj@kernel.org> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit I mistakenly broke the subject of the patch. I will send the complete one again. On Sun, 4 Feb 2024 12:49:46 -0800 SeongJae Park wrote: > kdamond_apply_schemes() checks apply intervals of schemes and avoid > further applying any schemes if no scheme passed its apply interval. > However, the following schemes applying function, > damon_do_apply_schemes() iterates all schemes without the apply interval > check. As a result, the shortest apply interval is applied to all > schemes. Fix the problem by checking the apply interval in > damon_do_apply_schemes(). > > Fixes: 42f994b71404 ("mm/damon/core: implement scheme-specific apply interval") > Cc: # 6.7.x > Signed-off-by: SeongJae Park > --- > mm/damon/core.c | 15 +++++++++++---- > 1 file changed, 11 insertions(+), 4 deletions(-) > > diff --git a/mm/damon/core.c b/mm/damon/core.c > index 0c144fb466b8..f444734cc613 100644 > --- a/mm/damon/core.c > +++ b/mm/damon/core.c > @@ -1064,6 +1064,9 @@ static void damon_do_apply_schemes(struct damon_ctx *c, > damon_for_each_scheme(s, c) { > struct damos_quota *quota = &s->quota; > > + if (c->passed_sample_intervals != s->next_apply_sis) > + continue; > + > if (!s->wmarks.activated) > continue; > > @@ -1216,10 +1219,6 @@ static void kdamond_apply_schemes(struct damon_ctx *c) > if (c->passed_sample_intervals != s->next_apply_sis) > continue; > > - s->next_apply_sis += > - (s->apply_interval_us ? s->apply_interval_us : > - c->attrs.aggr_interval) / sample_interval; > - > if (!s->wmarks.activated) > continue; > > @@ -1235,6 +1234,14 @@ static void kdamond_apply_schemes(struct damon_ctx *c) > damon_for_each_region_safe(r, next_r, t) > damon_do_apply_schemes(c, t, r); > } > + > + damon_for_each_scheme(s, c) { > + if (c->passed_sample_intervals != s->next_apply_sis) > + continue; > + s->next_apply_sis += > + (s->apply_interval_us ? s->apply_interval_us : > + c->attrs.aggr_interval) / sample_interval; > + } > } > > /* > -- > 2.39.2