public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
From: SeongJae Park <sj@kernel.org>
To: SeongJae Park <sj@kernel.org>
Cc: damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: (sashiko review) [RFC PATCH v5.1 01/11] mm/damon/core: handle <min_region_sz remaining quota as empty
Date: Sat, 11 Apr 2026 10:55:53 -0700	[thread overview]
Message-ID: <20260411175554.79572-1-sj@kernel.org> (raw)
In-Reply-To: <20260411164908.77189-2-sj@kernel.org>

TL; DR: no blocker of this patch from sashiko review.

Forwarding full sashiko review in a reply format with my 
inline comments below, for sharing details of my view and
doing followup discussions via mails if needed.

> # review url: https://sashiko.dev/#/patchset/20260411164908.77189-2-sj@kernel.org
> # start of sashiko.dev inline review
> commit 2f0a2c02b528b6c75ac3074d06b729bc93bd8589
> Author: SeongJae Park <sj@kernel.org>
> 
> mm/damon/core: handle <min_region_sz remaining quota as empty
> 
> This commit updates DAMON quota handling to treat a remaining quota of
> less than min_region_sz as effectively fully charged. This ensures that
> charge_target_from and charge_addr_from of the quota are updated properly,
> avoiding applying DAMOS actions too frequently to specific memory areas.
> 
> > diff --git a/mm/damon/core.c b/mm/damon/core.c
> > index 12544c60531d3..8dbc365bb8e97 100644
> > --- a/mm/damon/core.c
> > +++ b/mm/damon/core.c
> [ ... ]
> > @@ -2127,8 +2140,7 @@ static void damon_do_apply_schemes(struct damon_ctx *c,
> >  			continue;
> >  
> >  		/* Check the quota */
> > -		if (damos_quota_is_set(quota) &&
> > -				quota->charged_sz >= quota->esz)
> > +		if (damos_quota_is_full(quota, c->min_region_sz))
> >  			continue;
> 
> With this change, damon_do_apply_schemes() ensures that we only proceed
> to call damos_apply_scheme() when the remaining quota is at least
> c->min_region_sz.
> 
> Does this make the if (!sz) check inside damos_apply_scheme() unreachable?
> 
> mm/damon/core.c:damos_apply_scheme() {
> 	...
> 	if (c->ops.apply_scheme) {
> 		if (damos_quota_is_set(quota) &&
> 				quota->charged_sz + sz > quota->esz) {
> 			sz = ALIGN_DOWN(quota->esz - quota->charged_sz,
> 					c->min_region_sz);
> 			if (!sz)
> 				goto update_stat;
> 	...
> }
> 
> Since the remaining quota (quota->esz - quota->charged_sz) is guaranteed to
> be >= c->min_region_sz when reaching this point, ALIGN_DOWN will always
> result in sz >= c->min_region_sz.
> 
> Could this check and the goto be removed to clean up the dead code?

Same question was asked on the previous version of this patch.  My answer is
also same.  This makes sense but better to be done as a separate cleanup work.

> 
> 
> # end of sashiko.dev inline review
> # review url: https://sashiko.dev/#/patchset/20260411164908.77189-2-sj@kernel.org


Thanks,
SJ

# hkml [1] generated a draft of this mail.  You can regenerate
# this using below command:
#
#     hkml patch sashiko_dev --for_forwarding \
#             20260411164908.77189-2-sj@kernel.org
#
# [1] https://github.com/sjp38/hackermail


  reply	other threads:[~2026-04-11 17:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-11 16:48 [RFC PATCH v5.1 00/11] mm/damon: introduce DAMOS failed region quota charge ratio SeongJae Park
2026-04-11 16:48 ` [RFC PATCH v5.1 01/11] mm/damon/core: handle <min_region_sz remaining quota as empty SeongJae Park
2026-04-11 17:55   ` SeongJae Park [this message]
2026-04-11 16:48 ` [RFC PATCH v5.1 02/11] mm/damon/core: merge regions after applying DAMOS schemes SeongJae Park
2026-04-11 18:03   ` (sashiko review) " SeongJae Park
2026-04-11 16:48 ` [RFC PATCH v5.1 03/11] mm/damon/core: introduce failed region quota charge ratio SeongJae Park
2026-04-11 18:05   ` (sashiko review) " SeongJae Park
2026-04-11 16:48 ` [RFC PATCH v5.1 04/11] mm/damon/sysfs-schemes: implement fail_charge_{num,denom} files SeongJae Park
2026-04-11 16:48 ` [RFC PATCH v5.1 05/11] Docs/mm/damon/design: document fail_charge_{num,denom} SeongJae Park
2026-04-11 16:48 ` [RFC PATCH v5.1 06/11] Docs/admin-guide/mm/damon/usage: document fail_charge_{num,denom} files SeongJae Park
2026-04-11 16:49 ` [RFC PATCH v5.1 07/11] Docs/ABI/damon: document fail_charge_{num,denom} SeongJae Park
2026-04-11 16:49 ` [RFC PATCH v5.1 08/11] mm/damon/tests/core-kunit: test fail_charge_{num,denom} committing SeongJae Park
2026-04-11 16:49 ` [RFC PATCH v5.1 09/11] selftests/damon/_damon_sysfs: support failed region quota charge ratio SeongJae Park
2026-04-11 16:49 ` [RFC PATCH v5.1 10/11] selftests/damon/drgn_dump_damon_status: " SeongJae Park
2026-04-11 16:49 ` [RFC PATCH v5.1 11/11] selftests/damon/sysfs.py: test " SeongJae Park

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=20260411175554.79572-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=damon@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox