linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Liew Rui Yan <aethernet65535@gmail.com>
To: sj@kernel.org
Cc: aethernet65535@gmail.com, damon@lists.linux.dev, linux-mm@kvack.org
Subject: Re: [Question] mm/damon: min_nr_regions constraint and inconsistent error handling
Date: Thu, 19 Mar 2026 16:36:39 +0800	[thread overview]
Message-ID: <20260319083639.36440-1-aethernet65535@gmail.com> (raw)
In-Reply-To: <20260319014624.97146-1-sj@kernel.org>

On Thu, Mar 19, 2026 at 9:46 AM SeongJae Park <sj@kernel.org> wrote:

> Hi Liew,

Hi SeongJae,

> The initial version of DAMON was supporting only 'vaddr' operation set.  And
> 'vaddr' is designed to have at least three regions, for the two large unmapped
> areas on normal virtual address spaces.  Hence we enforced min_nr_regions to be
> three or larger.

Thanks for your explanation! It makes perfect sense.

> Yes, I think this is a nice idea.  Maybe adding a comment on damon_set_attrs(),
> or additional sentences to 'Monitoring' section of design.rst [2] would be
> appropriate.

Agreed. I will try to figure out which method is better, and I might
send out a patch in the near future.

> I'd like to be cautious about adding logging, as it might be a spam.  I'd
> prefer making it documented well.  Then, users could find what is wrong.

I see. I understand your concern about log spam, I will focus on
documentation.

> I believe the above command should returned an error.  If not, please let me
> know.

I re-tested it on v7.0-rc4 and it did NOT return any error when writing
'Y' to 'commit_inputs' with an invalid 'min_nr_regions=1'.

This might be unintended. Here is the full log of my session:

    [root@virtme-ng x86_64]# cd /sys/module/damon_lru_sort/parameters/
    [root@virtme-ng parameters]# cat enabled 
    N
    [root@virtme-ng parameters]# echo 65535 > max_nr_regions
    [root@virtme-ng parameters]# echo 3 > min_nr_regions 
    [root@virtme-ng parameters]# echo Y > enabled 
    [root@virtme-ng parameters]# cat kdamond_pid 
    89
    [root@virtme-ng parameters]# echo 1 > min_nr_regions 
    [root@virtme-ng parameters]# echo Y > commit_inputs 
    [root@virtme-ng parameters]# cat kdamond_pid 
    89
    [root@virtme-ng parameters]# cat enabled 
    Y
    [root@virtme-ng parameters]# ps aux | rg "kdamond" | rg -v "rg"
    root        89  0.0  0.0      0     0 ?        I    10:15   0:00 [kdamond.0]

> Also, if you know users who depend on the old behavior and therefore hoping the
> old behavior back, please let me know.

I don't know of anyone who depends on the old behavior.
I am a student exploring the kernel (DAMON) as a hobby, so my
perspective is limited to individual research rather than large-scale
production environments. However, the current behavior (staying alive
with valid params) feels much more sensible to me. But it should return
an error when 'commit_inputs=Y'.

---

Plan
====
Based on our discussion, my current plan is to:
1. Document the 'min_nr_regions' constraint in admin-guide.
2. Add the design rationale for the "at least 3 regions" rule in
   design.rst.
3. Remove the outdated sentences claiming DAMON will disable itself on
   invalid parameters input.
4. Investigate and try to fix the missing error return for
   'commit_inputs'.

Does this plan cover everything you'd expect?

Best regards,
Rui Yan

[...]


  reply	other threads:[~2026-03-19  8:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-18 15:37 Liew Rui Yan
2026-03-19  1:23 ` SeongJae Park
2026-03-19  1:46   ` SeongJae Park
2026-03-19  8:36     ` Liew Rui Yan [this message]
2026-03-19 15:15       ` 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=20260319083639.36440-1-aethernet65535@gmail.com \
    --to=aethernet65535@gmail.com \
    --cc=damon@lists.linux.dev \
    --cc=linux-mm@kvack.org \
    --cc=sj@kernel.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