All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jinjie Ruan" <ruanjinjie@huawei.com>,
	sj@kernel.org, akpm@linux-foundation.org, david@kernel.org,
	ljs@kernel.org, liam@infradead.org, vbabka@kernel.org,
	rppt@kernel.org, surenb@google.com, mhocko@suse.com,
	corbet@lwn.net, skhan@linuxfoundation.org, rdunlap@infradead.org,
	damon@lists.linux.dev, linux-mm@kvack.org
Subject: Re: [RFC PATCH] mm/damon/reclaim: allow disabling watermarks to force reclaim of cold pages
Date: Tue, 20 Oct 2026 14:00:45 +0000	[thread overview]
Message-ID: <sashiko-outbox-179075@kernel.org> (raw)
In-Reply-To: <20261020133233.3920818-1-ruanjinjie@huawei.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Low] mm/damon/reclaim: missing kernel-parameters.txt entry for ignore_wmarks
- [Low] mm/damon/reclaim: inaccurate ignore_wmarks parameter apply documentation
--

commit 8e407c81e469d1e743666b3331a460c372ffea07
Author: Jinjie Ruan <ruanjinjie@huawei.com>

mm/damon/reclaim: allow disabling watermarks to force reclaim of cold pages

This commit adds the ignore_wmarks module parameter to DAMON_RECLAIM so
that the scheme can use DAMOS_WMARK_NONE and reclaim cold pages even when
free memory is plentiful.

> diff --git a/Documentation/admin-guide/mm/damon/reclaim.rst b/Documentation/admin-guide/mm/damon/reclaim.rst
> index ec7e3e32b4ac6..ef57f60a91059 100644
> --- a/Documentation/admin-guide/mm/damon/reclaim.rst
> +++ b/Documentation/admin-guide/mm/damon/reclaim.rst
> @@ -159,6 +159,23 @@ this auto-tuning feature.
>  
>  Disabled by default.
>  
> +ignore_wmarks
> +-------------
> +
> +Ignore the watermarks-based scheme activation condition.
> +
> +If set to ``Y``, DAMON_RECLAIM runs its scheme regardless of the system's
> +free memory rate, so the reclaim is bounded only by ``min_age`` and the
> +quota.  This is useful when cold pages should be reclaimed even while the
> +system still has free memory, e.g. to squeeze the cold anonymous pages of a
> +just-parked virtual machine out immediately.
> +
> +By default, ``N``, so the scheme is activated based on the system's free
> +memory rate, as described for the watermarks below.
> +
> +Changes take effect when the scheme is rebuilt, i.e. on the next ``enabled``
> +``0 -> 1`` transition, like the other DAMON_RECLAIM parameters.

[Severity: Low]
Is this description of when changes take effect accurate?

In mm/damon/reclaim.c, ignore_wmarks is applied in
damon_reclaim_apply_parameters() and committed via damon_commit_ctx().
Because damon_reclaim_commit_inputs_store() invokes
damon_reclaim_commit_inputs_fn() -> damon_reclaim_apply_parameters():

    static int damon_reclaim_commit_inputs_fn(void *arg)
    {
        return damon_reclaim_apply_parameters();
    }

writing Y to commit_inputs also applies ignore_wmarks changes online while
DAMON_RECLAIM is already running, without requiring an enabled 0 -> 1
transition.

Could the documentation note that changes can also be applied online via
commit_inputs?

>  wmarks_interval
>  ---------------
>  
> diff --git a/mm/damon/reclaim.c b/mm/damon/reclaim.c
> index 014b0779ea6dd..effd963f3c783 100644
> --- a/mm/damon/reclaim.c
> +++ b/mm/damon/reclaim.c
> @@ -112,6 +112,23 @@ static struct damos_watermarks damon_reclaim_wmarks = {
>  };
>  DEFINE_DAMON_MODULES_WMARKS_PARAMS(damon_reclaim_wmarks);
>  
> +/*
> + * Ignore the watermarks-based scheme activation condition.
> + *
> + * With the default ``N``, DAMON_RECLAIM runs its scheme only while the
> + * system's free memory rate is inside [wmarks_low, wmarks_mid].
> + * Reclaiming cold pages itself raises the free rate, so the scheme
> + * deactivates as soon as memory looks plentiful again.  For a VMM parking
> + * an idle sandbox, cold anonymous pages should be reclaimed immediately
> + * even while the host still has plenty of free memory; setting this ``Y``
> + * makes the scheme ignore the watermarks, so the reclaim is bounded only
> + * by min_age and the quota.
> + */
> +static bool ignore_wmarks __read_mostly;
> +module_param(ignore_wmarks, bool, 0600);
> +MODULE_PARM_DESC(ignore_wmarks,
> +	"Ignore watermarks: reclaim cold pages even while free memory is plentiful (default: false)");

[Severity: Low]
Since mm/damon/reclaim.c defines MODULE_PARAM_PREFIX as "damon_reclaim.",
registering ignore_wmarks via module_param() exposes
damon_reclaim.ignore_wmarks as a kernel command-line parameter at boot.

Should this patch also document damon_reclaim.ignore_wmarks in
Documentation/admin-guide/kernel-parameters.txt?

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261020133233.3920818-1-ruanjinjie@huawei.com?part=1


      parent reply	other threads:[~2026-10-20 14:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-20 13:32 [RFC PATCH] mm/damon/reclaim: allow disabling watermarks to force reclaim of cold pages Jinjie Ruan
2026-10-20 13:58 ` SJ Park
2026-10-20 16:07   ` Aveline Noir
2026-10-20 14:00 ` sashiko-bot [this message]

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=sashiko-outbox-179075@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=damon@lists.linux.dev \
    --cc=david@kernel.org \
    --cc=liam@infradead.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mhocko@suse.com \
    --cc=rdunlap@infradead.org \
    --cc=rppt@kernel.org \
    --cc=ruanjinjie@huawei.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=sj@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=surenb@google.com \
    --cc=vbabka@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 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.