Re: [PATCH v2] zram: fix idle age_sec underflow in idle_store()
From: Sergey Senozhatsky
Date: Mon Aug 31 2026 - 00:15:22 EST
On (26/08/28 10:24), Andrew Morton wrote:
> On Fri, 28 Aug 2026 16:31:49 +0800 Hao Jia <jiahao.kernel@xxxxxxxxx> wrote:
[..]
>
> Thanks. Sashiko asked a couple of questions about this change:
> https://sashiko.dev/#/patchset/20260828083149.45760-1-jiahao.kernel@xxxxxxxxx
> Does this early return prevent marking valid boot-time pages as idle?
> When a page is accessed during the first second of system boot, its ac_time
> would be 0.
There is no possibility for zram to hold pages during first second of
system boot, regardless of whether zram was configured as a swap device
or as a block device (mount-ed with real filesystem).
> Can the early return above bypass this zram device initialization check?
We already do that, e.g. when kstrtouint(buf, 0, &age_sec) fails. Apart
from that, that's not how one checks if device was initialized. We may
want to consolidate those checks, just for symmetry.