From: Brian Geffon <bgeffon@google.com>
To: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Minchan Kim <minchan@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCHv2 2/2] zram: clear IDLE flag in mark_idle()
Date: Mon, 28 Oct 2024 13:57:02 -0400 [thread overview]
Message-ID: <Zx_QblcMMLznXd4P@google.com> (raw)
In-Reply-To: <20241028153629.1479791-3-senozhatsky@chromium.org>
On Tue, Oct 29, 2024 at 12:36:15AM +0900, Sergey Senozhatsky wrote:
> 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.
Reported-by: Shin Kawamura <kawasin@google.com>
>
> Fixes: 755804d16965 ("zram: introduce an aged idle interface")
> Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Acked-by: Brian Geffon <bgeffon@google.com>
> ---
> drivers/block/zram/zram_drv.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
> index a16dbffcdca3..cee49bb0126d 100644
> --- a/drivers/block/zram/zram_drv.c
> +++ b/drivers/block/zram/zram_drv.c
> @@ -410,6 +410,8 @@ static void mark_idle(struct zram *zram, ktime_t cutoff)
> #endif
> if (is_idle)
> zram_set_flag(zram, index, ZRAM_IDLE);
> + else
> + zram_clear_flag(zram, index, ZRAM_IDLE);
> zram_slot_unlock(zram, index);
> }
> }
> --
> 2.47.0.163.g1226f6d8fa-goog
>
next prev parent reply other threads:[~2024-10-28 17:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-28 15:36 [PATCHv2 0/2] zram: IDLE flag handling fixes Sergey Senozhatsky
2024-10-28 15:36 ` [PATCHv2 1/2] zram: clear IDLE flag after recompression Sergey Senozhatsky
2024-10-28 17:56 ` Brian Geffon
2024-10-28 15:36 ` [PATCHv2 2/2] zram: clear IDLE flag in mark_idle() Sergey Senozhatsky
2024-10-28 17:57 ` Brian Geffon [this message]
2024-10-29 0:09 ` Sergey Senozhatsky
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=Zx_QblcMMLznXd4P@google.com \
--to=bgeffon@google.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=minchan@kernel.org \
--cc=senozhatsky@chromium.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 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.