The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] mm/damon/stat: use secs_to_jiffies() instead of msecs_to_jiffies()
@ 2026-06-15 21:41 Philippe Laferriere
  2026-06-16  1:04 ` SeongJae Park
  0 siblings, 1 reply; 2+ messages in thread
From: Philippe Laferriere @ 2026-06-15 21:41 UTC (permalink / raw)
  To: Andrew Morton, SeongJae Park
  Cc: damon, linux-mm, linux-kernel, Philippe Laferriere

The conversion of a duration expressed in seconds reads as
msecs_to_jiffies(5 * MSEC_PER_SEC), which obscures the intent and
needlessly goes through milliseconds. Use the dedicated
secs_to_jiffies() helper, which expresses the 5-second refresh
interval directly. No functional change.

Found using Coccinelle (scripts/coccinelle/misc/secs_to_jiffies.cocci).

Signed-off-by: Philippe Laferriere <plafer@proton.me>
---
 mm/damon/stat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/damon/stat.c b/mm/damon/stat.c
index 0e14f5bb8f75..b05b68f73e10 100644
--- a/mm/damon/stat.c
+++ b/mm/damon/stat.c
@@ -138,7 +138,7 @@ static int damon_stat_damon_call_fn(void *data)
 
 	/* avoid unnecessarily frequent stat update */
 	if (time_before_eq(jiffies, damon_stat_last_refresh_jiffies +
-				msecs_to_jiffies(5 * MSEC_PER_SEC)))
+				secs_to_jiffies(5)))
 		return 0;
 	damon_stat_last_refresh_jiffies = jiffies;
 

base-commit: e3d8707358ea76b78bdec9928937bb9a797f2c8f
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mm/damon/stat: use secs_to_jiffies() instead of msecs_to_jiffies()
  2026-06-15 21:41 [PATCH] mm/damon/stat: use secs_to_jiffies() instead of msecs_to_jiffies() Philippe Laferriere
@ 2026-06-16  1:04 ` SeongJae Park
  0 siblings, 0 replies; 2+ messages in thread
From: SeongJae Park @ 2026-06-16  1:04 UTC (permalink / raw)
  To: Philippe Laferriere
  Cc: SeongJae Park, Andrew Morton, damon, linux-mm, linux-kernel

On Mon, 15 Jun 2026 21:41:43 +0000 Philippe Laferriere <plafer@proton.me> wrote:

> The conversion of a duration expressed in seconds reads as
> msecs_to_jiffies(5 * MSEC_PER_SEC), which obscures the intent and
> needlessly goes through milliseconds. Use the dedicated
> secs_to_jiffies() helper, which expresses the 5-second refresh
> interval directly. No functional change.

Thank you for this patch!

> 
> Found using Coccinelle (scripts/coccinelle/misc/secs_to_jiffies.cocci).
> 
> Signed-off-by: Philippe Laferriere <plafer@proton.me>

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

I applied  this patch to damon/next [1] tree.  We are now in the merge window.
We (mm community) want to focus on making the stabilized mm changes be merged
into the mainline until the merge window is closed, rather than adding more
changes that are not really urgent.  I understand this patch is not really
urgent.  Hence, Andrew might not add this patch until next -rc1 release.  In
the case, I will request adding this to mm.git after next -rc1 release.  So, no
action from your side is needed for now.  Let me know if you think this is
really  urgent.

[1] https://origin.kernel.org/doc/html/latest/mm/damon/maintainer-profile.html#scm-trees


Thanks,
SJ

[...]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-06-16  1:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-15 21:41 [PATCH] mm/damon/stat: use secs_to_jiffies() instead of msecs_to_jiffies() Philippe Laferriere
2026-06-16  1:04 ` SeongJae Park

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox