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: Andrew Morton <akpm@linux-foundation.org>,
	Liew Rui Yan <aethernet65535@gmail.com>,
	damon@lists.linux.dev, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org
Subject: Re: [PATCH v2 1/4] mm/damon/ops-common: optimize damon_hot_score() using ilog2()
Date: Mon, 27 Apr 2026 08:09:57 -0700	[thread overview]
Message-ID: <20260427150958.113205-1-sj@kernel.org> (raw)
In-Reply-To: <20260426231619.107231-2-sj@kernel.org>

On Sun, 26 Apr 2026 16:16:14 -0700 SeongJae Park <sj@kernel.org> wrote:

> From: Liew Rui Yan <aethernet65535@gmail.com>
[...]
> --- a/mm/damon/ops-common.c
> +++ b/mm/damon/ops-common.c
> @@ -117,9 +117,12 @@ int damon_hot_score(struct damon_ctx *c, struct damon_region *r,
>  		damon_max_nr_accesses(&c->attrs);
>  
>  	age_in_sec = (unsigned long)r->age * c->attrs.aggr_interval / 1000000;
> -	for (age_in_log = 0; age_in_log < DAMON_MAX_AGE_IN_LOG && age_in_sec;
> -			age_in_log++, age_in_sec >>= 1)
> -		;
> +	if (age_in_sec)
> +		age_in_log = min_t(int, ilog2(age_in_sec) + 1,
> +				DAMON_MAX_AGE_IN_LOG);
> +	else
> +		age_in_log = 0;
> +
>  
>  	/* If frequency is 0, higher age means it's colder */
>  	if (freq_subscore == 0)

Sashiko found this patch is introducing two blank lines.  Andrew, I saw you
already added this to mm-new.  Could you please add below attaching fixup?  If
you prefer reposting this patch, please let me know.


Thanks,
SJ

[...]
=== >8 ===
From 1d97945a7c35463d3757df985cf3545bf9d5ed9c Mon Sep 17 00:00:00 2001
From: SeongJae Park <sj@kernel.org>
Date: Mon, 27 Apr 2026 08:05:09 -0700
Subject: [PATCH] mm/damon/ops-common: (fixup) remove unnecessary blank line

Two blank lines are unnecessary.

The issue was discovered [1] by Sashiko.

[1] https://lore.kernel.org/20260426232811.618BFC2BCAF@smtp.kernel.org

Signed-off-by: SeongJae Park <sj@kernel.org>
---
 mm/damon/ops-common.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/mm/damon/ops-common.c b/mm/damon/ops-common.c
index 3a0ddc3ac7196..b2ce817f33c53 100644
--- a/mm/damon/ops-common.c
+++ b/mm/damon/ops-common.c
@@ -123,7 +123,6 @@ int damon_hot_score(struct damon_ctx *c, struct damon_region *r,
 	else
 		age_in_log = 0;
 
-
 	/* If frequency is 0, higher age means it's colder */
 	if (freq_subscore == 0)
 		age_in_log *= -1;
-- 
2.47.3




  reply	other threads:[~2026-04-27 15:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-26 23:16 [PATCH v2 0/4] mm/damon: repost non-hotfix reviewed patches in damon/next tree SeongJae Park
2026-04-26 23:16 ` [PATCH v2 1/4] mm/damon/ops-common: optimize damon_hot_score() using ilog2() SeongJae Park
2026-04-27 15:09   ` SeongJae Park [this message]
2026-04-26 23:16 ` [PATCH v2 2/4] Docs/admin-guide/mm/damon: fix 'parametrs' typo SeongJae Park
2026-04-27 23:39   ` SeongJae Park
2026-04-26 23:16 ` [PATCH v2 3/4] mm/damon: add synchronous commit for commit_inputs SeongJae Park
2026-04-26 23:16 ` [PATCH v2 4/4] mm/damon: support MADV_COLLAPSE via DAMOS_COLLAPSE scheme action SeongJae Park
2026-04-27 23:41   ` 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=20260427150958.113205-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=aethernet65535@gmail.com \
    --cc=akpm@linux-foundation.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