All of lore.kernel.org
 help / color / mirror / Atom feed
From: SeongJae Park <sj@kernel.org>
To: Honggyu Kim <honggyu.kim@sk.com>
Cc: SeongJae Park <sj@kernel.org>,
	damon@lists.linux.dev, Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, kernel_team@skhynix.com,
	Yunjeong Mun <yunjeong.mun@sk.com>
Subject: Re: [PATCH 2/3] samples/damon: change enable parameters to enabled
Date: Sun, 22 Jun 2025 09:14:22 -0700	[thread overview]
Message-ID: <20250622161422.50852-1-sj@kernel.org> (raw)
In-Reply-To: <20250622120926.1712-3-honggyu.kim@sk.com>

Hi Honggyu,

On Sun, 22 Jun 2025 21:09:24 +0900 Honggyu Kim <honggyu.kim@sk.com> wrote:

> The damon_{lru_sort,reclaim,stat} kernel modules use "enabled"
> parameter knobs as follows.
> 
>   /sys/module/damon_lru_sort/parameters/enabled
>   /sys/module/damon_reclaim/parameters/enabled
>   /sys/module/damon_stat/parameters/enabled
> 
> However, other sample modules of damon use "enable" parameter knobs so
> it'd be better to rename them from "enable" to "enabled" to keep the
> consistency with other damon modules.

I think this is a good change, thank you!

[...]
> 
> Signed-off-by: Honggyu Kim <honggyu.kim@sk.com>
> Cc: Yunjeong Mun <yunjeong.mun@sk.com>

I have simple comments about variable names below.  If you address it, please
feel free to add below.

Reviewed-by: SeongJae Park <sj@kernel.org>

> ---
>  samples/damon/mtier.c | 16 ++++++++--------
>  samples/damon/prcl.c  | 16 ++++++++--------
>  samples/damon/wsse.c  | 16 ++++++++--------
>  3 files changed, 24 insertions(+), 24 deletions(-)
> 
> diff --git a/samples/damon/mtier.c b/samples/damon/mtier.c
> index f3220d6e6739..cb273bf4b5c2 100644
> --- a/samples/damon/mtier.c
> +++ b/samples/damon/mtier.c
> @@ -33,14 +33,14 @@ module_param(node0_mem_free_bp, ulong, 0600);
>  static int damon_sample_mtier_enable_store(
>  		const char *val, const struct kernel_param *kp);
>  
> -static const struct kernel_param_ops enable_param_ops = {
> +static const struct kernel_param_ops enabled_param_ops = {
>  	.set = damon_sample_mtier_enable_store,
>  	.get = param_get_bool,
>  };
>  
> -static bool enable __read_mostly;
> -module_param_cb(enable, &enable_param_ops, &enable, 0600);
> -MODULE_PARM_DESC(enable, "Enable of disable DAMON_SAMPLE_MTIER");
> +static bool enabled __read_mostly;
> +module_param_cb(enabled, &enabled_param_ops, &enabled, 0600);
> +MODULE_PARM_DESC(enabled, "Enable or disable DAMON_SAMPLE_MTIER");
>  
>  static struct damon_ctx *ctxs[2];
>  
> @@ -160,17 +160,17 @@ static void damon_sample_mtier_stop(void)
>  static int damon_sample_mtier_enable_store(
>  		const char *val, const struct kernel_param *kp)
>  {
> -	bool enabled = enable;
> +	bool enable = enabled;

The local variable is to cache the old state of the parameter.  Hence I think
'enable' is not a very good name here.  I'd prefer naming the local variable
and similar ones on other sample modules as 'is_enabled' or somewhat else that
better represents its usage.

[...]
> diff --git a/samples/damon/prcl.c b/samples/damon/prcl.c
[...]
> @@ -112,17 +112,17 @@ static void damon_sample_prcl_stop(void)
>  static int damon_sample_prcl_enable_store(
>  		const char *val, const struct kernel_param *kp)
>  {
> -	bool enabled = enable;
> +	bool enable = enabled;

Ditto.

[...]
> diff --git a/samples/damon/wsse.c b/samples/damon/wsse.c
[...]
> @@ -92,17 +92,17 @@ static void damon_sample_wsse_stop(void)
>  static int damon_sample_wsse_enable_store(
>  		const char *val, const struct kernel_param *kp)
>  {
> -	bool enabled = enable;
> +	bool enable = enabled;

Here, too.

[...]


Thanks,
SJ

  reply	other threads:[~2025-06-22 16:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-22 12:09 [PATCH 0/3] mm/damon: Enhance damon and its samples Honggyu Kim
2025-06-22 12:09 ` [PATCH 1/3] mm/damon: do not allow creating zero size region Honggyu Kim
2025-06-22 16:04   ` SeongJae Park
2025-06-23  2:58     ` Honggyu Kim
2025-06-23 18:03       ` SeongJae Park
2025-06-25 22:24         ` Honggyu Kim
2025-06-26 15:27           ` SeongJae Park
2025-06-27 11:29             ` Honggyu Kim
2025-06-22 12:09 ` [PATCH 2/3] samples/damon: change enable parameters to enabled Honggyu Kim
2025-06-22 16:14   ` SeongJae Park [this message]
2025-06-23  3:04     ` Honggyu Kim
2025-06-22 12:09 ` [PATCH 3/3] samples/damon: fix bugs for damon sample for start failures Honggyu Kim
2025-06-22 16:29   ` SeongJae Park
2025-06-23  3:16     ` Honggyu Kim
2025-06-23 18:11       ` SeongJae Park
2025-06-25 22:27         ` Honggyu Kim
2025-06-26 15:28           ` 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=20250622161422.50852-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=damon@lists.linux.dev \
    --cc=honggyu.kim@sk.com \
    --cc=kernel_team@skhynix.com \
    --cc=linux-mm@kvack.org \
    --cc=yunjeong.mun@sk.com \
    /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.