]> www.infradead.org Git - users/jedix/linux-maple.git/commit
zram: Shrink zram_table_entry::flags.
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Fri, 6 Sep 2024 14:14:45 +0000 (16:14 +0200)
committerJens Axboe <axboe@kernel.dk>
Fri, 6 Sep 2024 14:51:08 +0000 (08:51 -0600)
commit68d20eb60efbdc80662efedeb088353e9c4aa17f
tree008eb7b4c8374097a2766b8f8f792f8901bc2e8d
parent6086aeb49e3d9e25165769b2a0a13ff67f98a1a2
zram: Shrink zram_table_entry::flags.

The zram_table_entry::flags member is of type long and uses 8 bytes on a
64bit architecture. With a PAGE_SIZE of 256KiB we have PAGE_SHIFT of 18
which in turn leads to __NR_ZRAM_PAGEFLAGS = 27. This still fits in an
ordinary integer.
By reducing the size of `flags' to four bytes, the size of the struct
goes back to 16 bytes. The padding between the lock and ac_time (if
enabled) is also gone.

Make zram_table_entry::flags an unsigned int and update the build test
to reflect the change.

Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Link: https://lore.kernel.org/r/20240906141520.730009-4-bigeasy@linutronix.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/zram/zram_drv.c
drivers/block/zram/zram_drv.h