[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231108033244.GH11577@google.com>
Date: Wed, 8 Nov 2023 12:32:44 +0900
From: Sergey Senozhatsky <senozhatsky@...omium.org>
To: Vasily Averin <vasily.averin@...ux.dev>
Cc: Sergey Senozhatsky <senozhatsky@...omium.org>,
Minchan Kim <minchan@...nel.org>, linux-kernel@...r.kernel.org,
linux-block@...r.kernel.org, zhouxianrong <zhouxianrong@...wei.com>
Subject: Re: [PATCH] zram: extra zram_get_element call in
zram_read_from_zspool()
On (23/11/08 06:16), Vasily Averin wrote:
> On 11/8/23 05:49, Sergey Senozhatsky wrote:
> > On (23/11/06 22:55), Vasily Averin wrote:
> >>
> >> 'element' and 'handle' are union in struct zram_table_entry.
> >>
> >> Fixes: 8e19d540d107 ("zram: extend zero pages to same element pages")
> >
> > Sorry, what exactly does it fix?
>
> It removes unneeded call of zram_get_element() and unneeded variable 'value'.
Yes, what the patch does is pretty clear. It doesn't *fix* anything per se.
> zram_get_element() == zram_get_handle(), they both access the same field of the same struct zram_table_entry,
> no need to read it 2nd time.
> 'value' variable is not required, 'handle' can be used instead.
>
> I hope this explain why element/handle union should be removed: it confuses reviewers.
I do not agree with "union should be removed" part.
In this particular case - using handle as the page pattern (element)
is in fact quite confusing. The visual separation of `handle` and `element`
is helpful.
Powered by blists - more mailing lists