tty: shrink the size of struct tty_struct by 40 bytes
It's been a long time since anyone has looked at what struct tty_struct looks like in memory, turns out there was a ton of holes. So move things around a bit, change one variable (closing) from being an int to a bool (it is only being tested for 0/1), and we end up saving 40 bytes per structure overall on x86-64 systems. Before this patch: /* size: 696, cachelines: 11, members: 37 */ /* sum members: 665, holes: 8, sum holes: 31 */ /* forced alignments: 2, forced holes: 1, sum forced holes: 4 */ /* last cacheline: 56 bytes */ After this change: /* size: 656, cachelines: 11, members: 37 */ /* sum members: 654, holes: 1, sum holes: 2 */ /* forced alignments: 2 */ /* last cacheline: 16 bytes */ Cc: Jiri Slaby <jirislaby@kernel.org> Link: https://lore.kernel.org/r/2023082519-cobbler-unholy-8d1f@gregkh Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Please register or sign in to comment