printk: move printk_info into separate array
authorJohn Ogness <john.ogness@linutronix.de>
Fri, 18 Sep 2020 22:34:19 +0000 (00:40 +0206)
committerPetr Mladek <pmladek@suse.com>
Tue, 22 Sep 2020 09:09:42 +0000 (11:09 +0200)
commitcfe2790b163acdc9c058a63bff310923e84a16b4
tree6c54003be5c53de5a84358669ebb1dc3a71a4430
parentf5f022e53b874f978dda23847173cbf2589b07f5
printk: move printk_info into separate array

The majority of the size of a descriptor is taken up by meta data,
which is often not of interest to the ringbuffer (for example,
when performing state checks). Since descriptors are often
temporarily stored on the stack, keeping their size minimal will
help reduce stack pressure.

Rather than embedding the printk_info into the descriptor, create
a separate printk_info array. The index of a descriptor in the
descriptor array corresponds to the printk_info with the same
index in the printk_info array. The rules for validity of a
printk_info match the existing rules for the data blocks: the
descriptor must be in a consistent state.

Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20200918223421.21621-2-john.ogness@linutronix.de
kernel/printk/printk.c
kernel/printk/printk_ringbuffer.c
kernel/printk/printk_ringbuffer.h