From: sashiko-bot@kernel.org
To: "SJ Park" <sj@kernel.org>
Cc: damon@lists.linux.dev
Subject: Re: [PATCH 1/3] mm/damon/ops-common: fix age_in_sec overflow on 32-bit
Date: Tue, 06 Oct 2026 07:00:44 +0000 [thread overview]
Message-ID: <20261006070045.1FD771F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20261006065209.41507-2-sj@kernel.org>
> From: Jaeyeon Lee <jaeyeon.lee.dev@gmail.com>
>
> damon_hot_score() calculates the age of a region by multiplying r->age
> and the aggregation interval. On 32-bit architectures, unsigned long
> is 32 bits, so the multiplication overflows once the age exceeds about
> 4295 seconds. Then old regions are scored as if they were young.
>
> Fix it by doing the calculation in 64-bit arithmetic using div_u64().
> Also make age_in_sec u64, so the result is not truncated back to 32
> bits.
>
> The issue was discovered [1] by Sashiko.
>
> [1] https://lore.kernel.org/20260623011652.1354-1-sj@kernel.org
>
> Fixes: 198f0f4c58b9 ("mm/damon/vaddr,paddr: support pageout prioritization")
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Assisted-by: LLM
> Signed-off-by: Jaeyeon Lee <jaeyeon.lee.dev@gmail.com>
> Reviewed-by: SJ Park <sj@kernel.org>
> Signed-off-by: SJ Park <sj@kernel.org>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261006065209.41507-1-sj@kernel.org?part=1
next prev parent reply other threads:[~2026-10-06 7:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-06 6:52 [PATCH 0/3] mm/damon: fix a minor bug, clean code, and add a test SJ Park
2026-10-06 6:52 ` [PATCH 1/3] mm/damon/ops-common: fix age_in_sec overflow on 32-bit SJ Park
2026-10-06 7:00 ` sashiko-bot [this message]
2026-10-06 6:52 ` [PATCH 2/3] mm/damon: use damon_get_monitor_folio() for hugetlb entries SJ Park
2026-10-06 6:58 ` sashiko-bot
2026-10-06 6:52 ` [PATCH 3/3] mm/damon/tests/core-kunit: add test for unconditionally skipping the last region SJ Park
2026-10-06 6:55 ` sashiko-bot
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=20261006070045.1FD771F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=damon@lists.linux.dev \
--cc=sashiko-reviews@lists.linux.dev \
--cc=sj@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox