All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liew Rui Yan <aethernet65535@gmail.com>
To: sashiko-bot@kernel.org
Cc: aethernet65535@gmail.com, damon@lists.linux.dev,
	sashiko-reviews@lists.linux.dev
Subject: Re: [PATCH v2] mm/damon/core: allow esz to be set to zero
Date: Wed,  2 Sep 2026 17:51:30 +0800	[thread overview]
Message-ID: <20260902095136.282835-1-aethernet65535@gmail.com> (raw)
In-Reply-To: <20260902083047.6D4081F000E9@smtp.kernel.org>

On Wed, 02 Sep 2026 08:30:46 +0000 sashiko-bot@kernel.org wrote:

> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [High] The patch breaks purely time-based quotas by unconditionally zeroing the effective size quota (`esz`) for DAMOS schemes without goals.
> --
> 
> commit 34629844ff11daf28855cce5457468ad8bc08c73
> Author: Liew Rui Yan <aethernet65535@gmail.com>
> 
> mm/damon/core: allow esz to be set to zero
> 
> This commit updates damos_set_effective_quota() to allow the effective quota
> to be set to zero when the temporal quota goal tuner achieves its goal.
> Previously, the quota was clamped to min_region_sz, preventing it from
> reaching zero.
> 
> > diff --git a/mm/damon/core.c b/mm/damon/core.c
> > index df22621765911..73dc9a70fb12b 100644
> > --- a/mm/damon/core.c
> > +++ b/mm/damon/core.c
> > @@ -3251,6 +3251,9 @@ static void damos_set_effective_quota(struct damon_ctx *ctx, struct damos *s)
> >  	if (quota->sz && quota->sz < esz)
> >  		esz = quota->sz;
> >  
> > +	if (!quota->esz_bp)
> > +		esz = 0;
> > +
> 
> [Severity: High]
> Could this cause a regression for schemes that use purely time-based quotas?
> 
> If a scheme is configured with a time-based quota (quota->ms > 0) but has no
> quota goals (list_empty(&quota->goals)), quota->esz_bp remains at its default
> initialization value of 0.
> 
> While damos_set_effective_quota() correctly computes esz from the throughput
> and quota->ms, this unconditional check will then force esz to 0 because
> quota->esz_bp is 0. An esz of 0 causes damos_quota_is_full() to always return
> true, effectively breaking schemes relying only on time-based quotas.

Yes, thank you for pointing this out!

esz_bp is a meaningful field only when (!list_empty(&quota->goals)), so
the correct check should be:

'''
if (!list_empty(&quota->goals) && !quota->esz_bp)
    esz = 0;
'''

> 
> >  	quota->esz = esz;
> >  }
> >
> 
> -- 
> Sashiko AI review · https://sashiko.dev/#/patchset/20260902082050.19566-1-aethernet65535@gmail.com?part=1

Best regards,
Rui Yan

  reply	other threads:[~2026-09-02  9:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-02  8:20 [PATCH v2] mm/damon/core: allow esz to be set to zero Liew Rui Yan
2026-09-02  8:30 ` sashiko-bot
2026-09-02  9:51   ` Liew Rui Yan [this message]
2026-09-02 14:13 ` SJ Park
2026-09-02 14:35   ` Liew Rui Yan
2026-09-02 15:03     ` SJ Park
2026-09-02 23:12       ` Liew Rui Yan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260902095136.282835-1-aethernet65535@gmail.com \
    --to=aethernet65535@gmail.com \
    --cc=damon@lists.linux.dev \
    --cc=sashiko-bot@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.