All of lore.kernel.org
 help / color / mirror / Atom feed
From: SJ Park <sj@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Philippe Laferriere <plafer@proton.me>, SJ Park <sj@kernel.org>,
	damon@lists.linux.dev, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org
Subject: [PATCH 2/5] mm/damon/stat: use secs_to_jiffies() instead of msecs_to_jiffies()
Date: Mon, 29 Jun 2026 07:55:33 -0700	[thread overview]
Message-ID: <20260629145538.134832-3-sj@kernel.org> (raw)
In-Reply-To: <20260629145538.134832-1-sj@kernel.org>

From: Philippe Laferriere <plafer@proton.me>

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>
Reviewed-by: SJ Park <sj@kernel.org>
Signed-off-by: SJ Park <sj@kernel.org>
---
Changes from v1
- v1: https://lore.kernel.org/20260615214113.122923-1-plafer@proton.me
- Collect R-b: from SJ.
- Rebase to latest mm-new.

 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 0e14f5bb8f75d..b05b68f73e10d 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;
 
-- 
2.47.3

  parent reply	other threads:[~2026-06-29 14:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-29 14:55 [PATCH 0/5] mm/damon: five misc fixups SJ Park
2026-06-29 14:55 ` [PATCH 1/5] mm/damon/core: use kvmalloc for target regions array SJ Park
2026-06-30  5:57   ` SJ Park
2026-06-29 14:55 ` SJ Park [this message]
2026-06-29 14:55 ` [PATCH 3/5] Docs/{admin-guide,mm}/damon: fix DAMON documentation details SJ Park
2026-06-29 14:55 ` [PATCH 4/5] samples/damon: Fix typos in Kconfig help text SJ Park
2026-06-29 14:55 ` [PATCH 5/5] mm/damon/tests/core-kunit: add KUnit test for walk_control_obsolete behavior 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=20260629145538.134832-3-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=damon@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=plafer@proton.me \
    /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.