Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ratelimit: convert flags to int to save 8 bytes in size

Only bit 1 is used, making an unsigned long a total overkill.

This brings it from 40 to 32 bytes, which in turn shrinks user_struct from
136 to 128 bytes. Since the latter is allocated with hwalign, this means
the total usage goes down from 192 to 128 bytes per object.

No functional changes.

Link: https://lkml.kernel.org/r/20240817123754.240924-1-mjguzik@gmail.com
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Mateusz Guzik and committed by
Andrew Morton
d994c238 076979ee

+1 -1
+1 -1
include/linux/ratelimit_types.h
··· 19 19 int burst; 20 20 int printed; 21 21 int missed; 22 + unsigned int flags; 22 23 unsigned long begin; 23 - unsigned long flags; 24 24 }; 25 25 26 26 #define RATELIMIT_STATE_INIT_FLAGS(name, interval_init, burst_init, flags_init) { \