Re: [PATCH 1/3] zram: use u32 for entry ac_time tracking
From: Sergey Senozhatsky
Date: Mon Dec 15 2025 - 19:59:57 EST
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.