From mboxrd@z Thu Jan 1 00:00:00 1970 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 4ED584949FF; Wed, 6 May 2026 16:50:04 +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=1778086204; cv=none; b=cITbw/TqBISK7CgKtUOwqbz2btJoztWFFkGmotXnjwl0iBYqyrJEaQJ9XUl82rK/P57xZ2rXQn7H/Hoiv7QQHFqkK0qhYJg4f7PC+g/pN6QD6r0MGzpBnqJo3elcU5yCXix2iMAY7yDgfjw+hvDm5+74ipx559NJUEA/j/LMT7s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778086204; c=relaxed/simple; bh=rHRcuoR5P9wwMkW6JidPfr71QvOcoQjlr6X4lJXWa+g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Q2vhXY4RfbdZ0bK22IhDGA/sUGJrgU/uXFoIpTHe9Ee5P2ZiRefiyQ7OJX4PeEhGurZCXhXUqFTVRKR3zgxKlgYYgn6Ta4liYys+lZeXzWJIUtD9YRYghOe4/wYh42JLwHZeyVV7ZCQKVGmsjcUHCe/XX5vkeWFlq1Km0Hfd/Ds= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NPpp1J5C; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="NPpp1J5C" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9D411C2BCB0; Wed, 6 May 2026 16:50:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778086203; bh=rHRcuoR5P9wwMkW6JidPfr71QvOcoQjlr6X4lJXWa+g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NPpp1J5CI6zlHedNz/l8F/E/WEGdV58B3syJ4s0yMtK8J38ICYEVJ8f5tcseFuYpv Jdgy1CpE0AfqqK1gjmyaJjlJh0Y8cKGqkq8eF9cV6F/JC6F1QrRRxuyZXFDINVVifC MZm8axQMp2dSSDiyFoVvlPeATJWQzK7hHo7aVFZ/ReEn4XdE7KDceUpz2djvaankCf 2200tlytNEge8I51Ni56YOgzeHPUmN120pyOZKQFvfF7kfIDLXSH8IaRYn104KpRC3 fQUAnCMR14y7FX3g1m5le1vM3SS7W1qVL2Oi/KBcYuniMbyHGY9oxyFz6JyCqglTiU IxmQPBQqnv1MA== From: SeongJae Park To: Greg Kroah-Hartman , sashiko-bot@kernel.org Cc: SeongJae Park , stable@vger.kernel.org, damon@lists.linux.dev Subject: Re: [PATCH 6.18.y] mm/damon/core: disallow time-quota setting zero esz Date: Wed, 6 May 2026 09:49:58 -0700 Message-ID: <20260506164959.10212-1-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260504170607.529EBC2BCB8@smtp.kernel.org> References: Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TL; DR: This patch is broken, please drop. I will send v2 soon, as a reply to this. Please read below for details. On Mon, 04 May 2026 17:06:06 +0000 sashiko-bot@kernel.org wrote: > Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: > - [Medium] The newly added `ctx` parameter in `damos_set_effective_quota()` is unused, and the function incorrectly uses the `DAMON_MIN_REGION` macro instead of `ctx->min_sz_region`. > -- > > commit 8afd735e4c663dcbcca090e71f37ad10c37c705a > Author: SeongJae Park > > mm/damon/core: disallow time-quota setting zero esz > > When DAMOS scheme throughput is very slow, the time quota can make the > effective size quota smaller than the context's minimum region size, causing > actions to be skipped. This commit attempts to fix the problem by ensuring > the effective size quota is at least the minimum region size. > > Link: https://lore.kernel.org/20260407003153.79589-1-sj@kernel.org > Link: https://lore.kernel.org/20260405192504.110014-1-sj@kernel.org [1] > > > diff --git a/mm/damon/core.c b/mm/damon/core.c > > --- a/mm/damon/core.c > > +++ b/mm/damon/core.c > > @@ -2124,7 +2124,8 @@ static unsigned long damos_quota_score(struct damos_quota *quota) > > /* > > * Called only if quota->ms, or quota->sz are set, or quota->goals is not empty > > */ > > -static void damos_set_effective_quota(struct damos_quota *quota) > > +static void damos_set_effective_quota(struct damos_quota *quota, > > + struct damon_ctx *ctx) > > { > > unsigned long throughput; > > unsigned long esz = ULONG_MAX; > > [ ... ] > > > @@ -2150,6 +2151,7 @@ static void damos_set_effective_quota(struct damos_quota *quota) > > else > > throughput = PAGE_SIZE * 1024; > > esz = min(throughput * quota->ms, esz); > > + esz = max(DAMON_MIN_REGION, esz); > > Should this be using ctx->min_sz_region instead of DAMON_MIN_REGION? > > The commit message mentions bounding the effective size quota to > damon_ctx->min_region_sz, and the ctx parameter was successfully added > to the function signature. > > However, the ctx parameter is left unused here and the macro is used as a > hardcoded bound instead. Since ctx->min_sz_region can be dynamically > configured, can the effective size quota still fall below it with this > implementation? Correct. Cherry-picking the original commit was causing build issue since the upstream commit is renamed field (min_region_sz). When fixing the build issue I mistakenly assumed the field itslef is not yet introduced to 6.18 and using DAMON_MIN_REGION. It should use the field that not yet renamed (min_sz_region), as Sashiko pointed out. Greg, please drop this. I will send a v2 soon, as a reply to this mail. > > > } > > > > if (quota->sz && quota->sz < esz) > > -- > Sashiko AI review ยท https://sashiko.dev/#/patchset/20260504130127.25364-1-sj@kernel.org?part=1 > Thanks, SJ