lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <gqkugg2q3hafwikx2wvnsh6oa44ifbtuskmigsqbrkaztjwj4i@33n5p55zq3nz>
Date: Tue, 16 Dec 2025 09:59:51 +0900
From: Sergey Senozhatsky <senozhatsky@...omium.org>
To: Brian Geffon <bgeffon@...gle.com>
Cc: Sergey Senozhatsky <senozhatsky@...omium.org>, 
	Andrew Morton <akpm@...ux-foundation.org>, Minchan Kim <minchan@...nel.org>, 
	David Stevens <stevensd@...gle.com>, linux-kernel@...r.kernel.org, linux-mm@...ck.org, 
	linux-block@...r.kernel.org
Subject: Re: [PATCH 1/3] zram: use u32 for entry ac_time tracking

On (25/12/15 17:31), Brian Geffon wrote:
[..]
> >  struct zram_table_entry {
> >         unsigned long handle;
> > -       unsigned long flags;
> > +       union {
> > +               unsigned long __lock;
> > +               struct attr {
> > +                       u32 flags;
> >  #ifdef CONFIG_ZRAM_TRACK_ENTRY_ACTIME
> > -       ktime_t ac_time;
> > +                       u32 ac_time;
> >  #endif
> 
> Why not just always enable CONFIG_ZRAM_TRACK_ENTRY_ACTIME now that it
> doesn't consume any additional space?

It's "free" only on x64.  On 32bit systems the removal of
ZRAM_TRACK_ENTRY_ACTIME will unconditionally add 4 bytes
per zram_table_entry.

> Also, why can't we do this with a single unsigned long flags
> as before and have a simple method that isolates and casts the
> lower 32bits as a u32?

There are no upper and lower 32 bits in unsigned long on 32bit systems.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ