linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Richard Chang <richardycc@google.com>
To: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Minchan Kim <minchan@kernel.org>,
	 Brian Geffon <bgeffon@google.com>,
	linux-block@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] zram: do not slot_free() written-back slots
Date: Thu, 19 Mar 2026 14:47:07 +0800	[thread overview]
Message-ID: <CALC_0q_2meJ7T8gvij5oR=idy9hn5rMC_RQhCbePJFVBOOd0Tw@mail.gmail.com> (raw)
In-Reply-To: <abt1dsjsT9826Ewy@google.com>

I think we also need clear_slot_flag(zram, index, ZRAM_PP_SLOT)

On Thu, Mar 19, 2026 at 12:06 PM Sergey Senozhatsky
<senozhatsky@chromium.org> wrote:
>
> As a side note:
>
> On (26/03/19 12:44), Sergey Senozhatsky wrote:
> > -     slot_free(zram, index);
> [..]
> > -             if (huge)
> > -                     set_slot_flag(zram, index, ZRAM_HUGE);
>
> Original code had a bug.  slot_free() would decrement ->huge_pages,
> then writeback completion would restore the HUGE flag, so when slot
> would get freed for real slot_free() would decrement ->huge_pages
> again, leading to underflow.


  reply	other threads:[~2026-03-19  6:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-19  3:44 Sergey Senozhatsky
2026-03-19  4:05 ` Sergey Senozhatsky
2026-03-19  6:47   ` Richard Chang [this message]
2026-03-19  7:21     ` Sergey Senozhatsky
2026-03-19 17:59   ` Minchan Kim
2026-03-19 19:43 ` Minchan Kim

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='CALC_0q_2meJ7T8gvij5oR=idy9hn5rMC_RQhCbePJFVBOOd0Tw@mail.gmail.com' \
    --to=richardycc@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=bgeffon@google.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-mm@kvack.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox