Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Liew Rui Yan <aethernet65535@gmail.com>
To: SJ Park <sj@kernel.org>
Cc: Liew Rui Yan <aethernet65535@gmail.com>,
	damon@lists.linux.dev, linux-mm@kvack.org
Subject: Re: [RFC] mm/damon/damo: saving damon sysfs configuration
Date: Wed, 30 Sep 2026 17:58:54 +0800	[thread overview]
Message-ID: <20260930100031.7338-1-aethernet65535@gmail.com> (raw)
In-Reply-To: <20260929074300.40012-1-sj@kernel.org>

On Tue, 29 Sep 2026 00:43:00 -0700 SJ Park <sj@kernel.org> wrote:

> Hi Liew,
> 
> On Tue, 29 Sep 2026 03:13:06 +0800 Liew Rui Yan <aethernet65535@gmail.com> wrote:
> 
> > Hi SJ and Community,
> > 
> > I've noticed that damo [1] doesn't seem to have a feature for saving
> > DAMON SYSFS configuration.  I tried 'damo args damon', but it doesn't
> > save the DAMOS schemes information.
> 
> If so, it is a bug.  Could you share more details including how the issue can
> be reproduced?  Directly sending a PR should also be fine.

Yes, this can be reproduced easily.

    # make sure DAMON is started
    $ sudo ./damo args damon > damo_args_damon.json
    $ sudo ./damo report damon --json > damo_report_damon.json

    $ sudo ./damo stop

    $ sudo ./damo start --kdamonds damo_args_damon.json
    $ sudo ./damo report damon --json > damo_report_damon_after.json

    $ diff damo_report_damon.json damo_report_damon_after.json
    4c4
    <         "pid": "4959",
    ---
    >         "pid": "5582",
    16,17c16,17
    <                                 "start": "4,294,967,296",
    <                                 "end": "15,807,283,199"
    ---
    >                                 "start": "4,096",
    >                                 "end": "15,807,283,200"
    25c25
    <                     "ops_update_us": "1 m",
    ---
    >                     "ops_update_us": "1 s",
    46,159c46
    <                 "schemes": [
    <                     {
    <                         "action": "pageout",
    <                         "dests": [],
    <                         "access_pattern": {
    <                             "sz_bytes": {
    <                                 "min": "4.000 KiB",
    <                                 "max": "max"
    <                             },
    <                             "nr_accesses": {
    <                                 "min": "0 samples",
    <                                 "max": "0 samples"
    <                             },
    <                             "age": {
    <                                 "min": "60,000 aggr_intervals",
    <                                 "max": "18,446,744,073,709,551,615 aggr_intervals"
    <                             }
    <                         },
    <                         "apply_interval_us": "0 ns",
    <                         "quotas": {
    <                             "time_ms": "0 ns",
    <                             "sz_bytes": "16.000 MiB",
    <                             "reset_interval_ms": "1 s",
    <                             "fail_charge_num": "0",
    <                             "fail_charge_denom": "0",
    <                             "goals": [
    <                                 {
    <                                     "metric": "user_input",
    <                                     "nid": "0",
    <                                     "memcg_path": "",
    <                                     "target_value": "3,000",
    <                                     "current_value": "7,855"
    <                                 }
    <                             ],
    <                             "goal_tuner": "temporal\n",
    <                             "effective_sz_bytes": "0 B",
    <                             "weights": {
    <                                 "sz_permil": "0 %",
    <                                 "nr_accesses_permil": "0 %",
    <                                 "age_permil": "0 %"
    <                             }
    <                         },
    <                         "watermarks": {
    <                             "metric": "none",
    <                             "interval_us": "0 ns",
    <                             "high_permil": "0 %",
    <                             "mid_permil": "0 %",
    <                             "low_permil": "0 %"
    <                         },
    <                         "filters": [],
    <                         "stats": {
    <                             "nr_tried": "0",
    <                             "sz_tried": "0 B",
    <                             "nr_applied": "0",
    <                             "sz_applied": "0 B",
    <                             "sz_ops_filter_passed": "0 B",
    <                             "qt_exceeds": "19",
    <                             "nr_snapshots": "0",
    <                             "max_nr_snapshots": "0"
    <                         }
    <                     },
    <                     {
    <                         "action": "stat",
    <                         "dests": [],
    <                         "access_pattern": {
    <                             "sz_bytes": {
    <                                 "min": "0 B",
    <                                 "max": "max"
    <                             },
    <                             "nr_accesses": {
    <                                 "min": "0 samples",
    <                                 "max": "18,446,744,073,709,551,615 samples"
    <                             },
    <                             "age": {
    <                                 "min": "0 aggr_intervals",
    <                                 "max": "18,446,744,073,709,551,615 aggr_intervals"
    <                             }
    <                         },
    <                         "apply_interval_us": "0 ns",
    <                         "quotas": {
    <                             "time_ms": "0 ns",
    <                             "sz_bytes": "0 B",
    <                             "reset_interval_ms": "0 ns",
    <                             "fail_charge_num": "0",
    <                             "fail_charge_denom": "0",
    <                             "goals": [],
    <                             "goal_tuner": "consist\n",
    <                             "effective_sz_bytes": "0 B",
    <                             "weights": {
    <                                 "sz_permil": "0 %",
    <                                 "nr_accesses_permil": "0 %",
    <                                 "age_permil": "0 %"
    <                             }
    <                         },
    <                         "watermarks": {
    <                             "metric": "none",
    <                             "interval_us": "0 ns",
    <                             "high_permil": "0 %",
    <                             "mid_permil": "0 %",
    <                             "low_permil": "0 %"
    <                         },
    <                         "filters": [],
    <                         "stats": {
    <                             "nr_tried": "2,000",
    <                             "sz_tried": "1.801 TiB",
    <                             "nr_applied": "0",
    <                             "sz_applied": "0 B",
    <                             "sz_ops_filter_passed": "0 B",
    <                             "qt_exceeds": "0",
    <                             "nr_snapshots": "172",
    <                             "max_nr_snapshots": "0"
    <                         }
    <                     }
    <                 ]
    ---
    >                 "schemes": []

> 
> > 'damo report damon --json' provides
> > more detailed information, but its output cannot be read by 'damo start
> > --kdamonds'.
> 
> Maybe this is also an issue that we could fix.

In my opinion, this is not an issue, since there's no documentation
recommending we use the 'damo report damon --json' to generate
configuration for 'damo start --kdamonds'.

> 
> > 
> > I'd like to know if there is currently any way in damo to save the DAMON
> > SYSFS configuration that can be correctly read by 'damo start
> > --kdamonds'.  If not, would it be worth adding one?
> 
> I believe it would be useful.  Please feel free to send a PR.
> 
> Nonetheless, we added the json/yaml kdamonds config support mainly because
> there was no good way to flexibly configure kdamonds with the command line
> interface.  Now it is much more improved [1].

Thank you for clarifying this!

> 
> I'd recommend using the command line interface.  That is, you could copy your
> command line setup in a bash script and modify/reuse it.
> 
> Is there a use case that it cannot work or suboptimum?

No, CLI (Command Line Interface) do very convenience.  I can write my
configuration in CLI and it is very readable.  Thank you for letting me
know this feature!

    #!/bin/bash

    # update-damon-config.sh

    ./damo args damon \
    --kdamond --damon_ctx --ops paddr \
        --monitoring_intervals 5000 100000 1000000 \
        --damon_target --regions 4294967296-15807283199 \
        --damos_scheme --damos_action pageout \
            --damos_sz_region 4096 18446744073709551615 \
            --damos_access_rate 0 0 \
            --damos_age 600000000 18446744073709551615 \
            --damos_quota_goal user_input 3000 10000 \
            --damos_quota_goal_tuner temporal \
            --damos_quota_interval 1000 \
            --damos_quota_time 0 \
            --damos_quota_space 16777216 \
            --damos_quota_weights 0 0 0 \
    > config.json

> 
> [1] https://github.com/damonitor/damo/issues/3#issuecomment-5655965736

[...]

Best regards,
Rui Yan


  reply	other threads:[~2026-09-30 10:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-28 19:13 [RFC] mm/damon/damo: saving damon sysfs configuration Liew Rui Yan
2026-09-29  7:43 ` SJ Park
2026-09-30  9:58   ` Liew Rui Yan [this message]
2026-10-08 12:09     ` Liew Rui Yan
2026-10-08 12:32       ` SJ Park
2026-10-08 13:44         ` Liew Rui Yan
2026-10-08 15:00           ` SJ Park
2026-10-08 16:14             ` Liew Rui Yan
2026-10-09  8:01               ` SJ 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=20260930100031.7338-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