* (no subject)
@ 2024-09-23 15:42 Sergey Senozhatsky
0 siblings, 0 replies; only message in thread
From: Sergey Senozhatsky @ 2024-09-23 15:42 UTC (permalink / raw)
To: Andrey Skvortsov, Venkat Rao Bagalkote
Cc: Minchan Kim, Jens Axboe, Andrew Morton, linux-kernel, linux-block,
stable, Sergey Senozhatsky
Bcc:
Subject: Re: [PATCH] zram: don't free statically defined names
Reply-To:
In-Reply-To: <20240923153449.GC38742@google.com>
Cc-ing Venkat Rao Bagalkote
On (24/09/24 00:34), Sergey Senozhatsky wrote:
> > for (prio = ZRAM_SECONDARY_COMP; prio < ZRAM_MAX_COMPS; prio++) {
> > - kfree(zram->comp_algs[prio]);
> > + /* Do not free statically defined compression algorithms */
>
> We probably don't really need this comment.
>
> > + if (zram->comp_algs[prio] != default_compressor)
> > + kfree(zram->comp_algs[prio]);
> > zram->comp_algs[prio] = NULL;
> > }
>
> OK, so... I wonder how do you get a `default_compressor` on a
> non-ZRAM_PRIMARY_COMP prio. May I ask what's your reproducer?
>
> I didn't expect `default_compressor` on ZRAM_SECONDARY_COMP
> and below. As far as I can tell, we only do this:
>
> comp_algorithm_set(zram, ZRAM_PRIMARY_COMP, default_compressor);
>
> in zram_reset_device() and zram_add(). So, how does it end up in
> ZRAM_SECONDARY_COMP...
Ugh, I know what's happening. You don't have CONFIG_ZRAM_MULTI_COMP
so that ZRAM_PRIMARY_COMP and ZRAM_SECONDARY_COMP are the same thing.
Yeah, that all makes sense now, I haven't thought about it.
Can you please send v2 (with the feedback resolved).
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-09-23 15:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-23 15:42 Sergey Senozhatsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox