]> www.infradead.org Git - users/jedix/linux-maple.git/commit
zram: clear IDLE flag in mark_idle()
authorSergey Senozhatsky <senozhatsky@chromium.org>
Mon, 28 Oct 2024 15:36:15 +0000 (00:36 +0900)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 1 Nov 2024 04:29:34 +0000 (21:29 -0700)
commitb3c88bf00a72ebace9615815f5817c2114c8d0e6
tree1b44e4d019b105c1d93289debe211b5e8de91c7c
parent1284b75d1ec44176f8ee15d11b621cbbf5614d22
zram: clear IDLE flag in mark_idle()

If entry does not fulfill current mark_idle() parameters, e.g.  cutoff
time, then we should clear its ZRAM_IDLE from previous mark_idle()
invocations.

Consider the following case:
- mark_idle() cutoff time 8h
- mark_idle() cutoff time 4h
- writeback() idle - will writeback entries with cutoff time 8h,
  while it should only pick entries with cutoff time 4h

The bug was reported by Shin Kawamura.

Link: https://lkml.kernel.org/r/20241028153629.1479791-3-senozhatsky@chromium.org
Fixes: 755804d16965 ("zram: introduce an aged idle interface")
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Reported-by: Shin Kawamura <kawasin@google.com>
Acked-by: Brian Geffon <bgeffon@google.com>
Cc: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/block/zram/zram_drv.c