Re: [RFC PATCH 4/9] mm/damon/core: use damos_quota_is_set() in damos_adjust_quota()
From: SJ Park
Date: Mon Sep 14 2026 - 22:31:32 EST
On Tue, 15 Sep 2026 10:19:43 +0800 KunWu Chan <kunwu.chan@xxxxxxxxx> wrote:
> On Mon, Sep 14, 2026 at 11:16 PM SJ Park <sj@xxxxxxxxxx> wrote:
> >
> > On Mon, 14 Sep 2026 23:01:48 +0800 Kunwu Chan <kunwu.chan@xxxxxxxxx> wrote:
> >
> > > On Sat, 12 Sep 2026 13:08:05 -0700 SJ Park <sj@xxxxxxxxxx> wrote:
[...]
> > So, if user sets only time quota, and then commits the quota to zero while the
> > esz is non-zero, esz is never reset to zero. As a result, DAMOS keeps applying
> > the action with the esz forever. Correct?
>
> Yes, the stale esz path is confirmed.
>
> One clarification, though: it does not keep applying the action
> forever. While charged_sz < stale_esz, damos_adjust_quota() still
> returns early, but damos_apply_target() continues to apply the
> scheme and damos_charge_quota() keeps increasing charged_sz.
>
> Once charged_sz >= stale_esz, damos_quota_is_full() returns true,
> so damon_do_apply_schemes() skips the scheme. Since the early return
> also prevents the charge-window handling from running,
> charged_sz is never reset, and the scheme remains permanently
> inactive.
>
> So clearing the quota can result in the scheme applying up to the
> stale esz, and then stopping permanently.
Thank you for detailed clarification, Kunwu!
>
> >
> > If so, this may deserve Cc-ing stable@. Kunwu, what do you think?
>
> I think this is a functional bug in the existing code, and Cc'ing
> stable makes sense.
Agreed. I will post this as a hotfix soon.
Thanks,
SJ
[...]