From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: Andrey Skvortsov <andrej.skvortzov@gmail.com>,
Venkat Rao Bagalkote <venkat88@linux.vnet.ibm.com>
Cc: Minchan Kim <minchan@kernel.org>, Jens Axboe <axboe@kernel.dk>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
stable@vger.kernel.org,
Sergey Senozhatsky <senozhatsky@chromium.org>
Subject: Re: [PATCH] zram: don't free statically defined names
Date: Tue, 24 Sep 2024 00:47:38 +0900 [thread overview]
Message-ID: <20240923154738.GE38742@google.com> (raw)
In-Reply-To: <20240923153449.GC38742@google.com>
** Re-sending properly, somehow I managed to badly mess up
the headers the first time, sorry ***
On (24/09/24 00:34), Sergey Senozhatsky wrote:
> On (24/09/23 11:02), Andrey Skvortsov 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).
next prev parent reply other threads:[~2024-09-23 15:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-23 8:02 [PATCH] zram: don't free statically defined names Andrey Skvortsov
2024-09-23 15:34 ` Sergey Senozhatsky
2024-09-23 15:47 ` Sergey Senozhatsky [this message]
2024-09-23 15:55 ` Andrey Skvortsov
2024-09-23 16:07 ` Sergey Senozhatsky
2024-09-23 16:43 ` Andrey Skvortsov
2024-09-23 16:47 ` Christophe JAILLET
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=20240923154738.GE38742@google.com \
--to=senozhatsky@chromium.org \
--cc=akpm@linux-foundation.org \
--cc=andrej.skvortzov@gmail.com \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=minchan@kernel.org \
--cc=stable@vger.kernel.org \
--cc=venkat88@linux.vnet.ibm.com \
/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.