linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: Vasily Averin <vasily.averin@linux.dev>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>,
	Minchan Kim <minchan@kernel.org>,
	linux-kernel@vger.kernel.org, linux-block@vger.kernel.org
Subject: Re: [PATCH] zram: extra zram_get_element call in zram_read_from_zspool()
Date: Wed, 8 Nov 2023 11:48:39 +0900	[thread overview]
Message-ID: <20231108024839.GF11577@google.com> (raw)
In-Reply-To: <f30438ab-01e4-4847-a72d-5a4107d7ba46@linux.dev>

On (23/11/06 23:03), Vasily Averin wrote:
> On 11/6/23 22:55, Vasily Averin wrote:
> > 'element' and 'handle' are union in struct zram_table_entry.
> 
> struct zram_table_entry {
>         union {
>                 unsigned long handle;
>                 unsigned long element;
>         };
> 
> I do not understand the sense of this union.
> From my POV it just makes it harder to check the code because an reviewer doesn't
> expect that the zram element can't be used together.
> Can I remove this union at all and replace zram_get/set_element calls by zram_get/set_handle instead?

I guess it sort of helps API-wise to distinguish zram_handle (allocated
zsmalloc object handle) and zram_element (same-filled entry).

I'll leave it to Minchan to decide.

  reply	other threads:[~2023-11-08  2:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-06 19:55 [PATCH] zram: extra zram_get_element call in zram_read_from_zspool() Vasily Averin
2023-11-06 20:03 ` Vasily Averin
2023-11-08  2:48   ` Sergey Senozhatsky [this message]
2023-11-08  2:49 ` Sergey Senozhatsky
2023-11-08  3:16   ` Vasily Averin
2023-11-08  3:32     ` Sergey Senozhatsky
2023-11-08  4:40       ` Vasily Averin

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=20231108024839.GF11577@google.com \
    --to=senozhatsky@chromium.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minchan@kernel.org \
    --cc=vasily.averin@linux.dev \
    /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;
as well as URLs for NNTP newsgroup(s).