mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 09:25:00 +01:00
In DAMON's damon_sysfs_repeat_call_fn(), time_before() is used to compare
the current jiffies with next_update_jiffies to determine whether to
update the sysfs files at this moment.
On 32-bit systems, the kernel initializes jiffies to "-5 minutes" to make
jiffies wrap bugs appear earlier. However, this causes time_before() in
damon_sysfs_repeat_call_fn() to unexpectedly return true during the first
5 minutes after boot on 32-bit systems (see [1] for more explanation,
which fixes another jiffies-related issue before). As a result, DAMON
does not update sysfs files during that period.
There is also an issue unrelated to the system's word size[2]: if the
user stops DAMON just after next_update_jiffies is updated and restarts
it after 'refresh_ms' or a longer delay, next_update_jiffies will retain
an older value, causing time_before() to return false and the update to
happen earlier than expected.
Fix these issues by making next_update_jiffies a global variable and
initializing it each time DAMON is started.
Link: https://lkml.kernel.org/r/20251030020746.967174-3-yanquanmin1@huawei.com
Link: https://lkml.kernel.org/r/20250822025057.1740854-1-ekffu200098@gmail.com [1]
Link: https://lore.kernel.org/all/20251029013038.66625-1-sj@kernel.org/ [2]
Fixes:
|
||
|---|---|---|
| .. | ||
| tests | ||
| core.c | ||
| Kconfig | ||
| lru_sort.c | ||
| Makefile | ||
| modules-common.c | ||
| modules-common.h | ||
| ops-common.c | ||
| ops-common.h | ||
| paddr.c | ||
| reclaim.c | ||
| stat.c | ||
| sysfs-common.c | ||
| sysfs-common.h | ||
| sysfs-schemes.c | ||
| sysfs.c | ||
| vaddr.c | ||