Skip to content

Commit a699449

Browse files
jognesspmladek
authored andcommitted
printk: refactor and rework printing logic
Refactor/rework printing logic in order to prepare for moving to threaded console printing. - Move @console_seq into struct console so that the current "position" of each console can be tracked individually. - Move @console_dropped into struct console so that the current drop count of each console can be tracked individually. - Modify printing logic so that each console independently loads, prepares, and prints its next record. - Remove exclusive_console logic. Since console positions are handled independently, replaying past records occurs naturally. - Update the comments explaining why preemption is disabled while printing from printk() context. With these changes, there is a change in behavior: the console replaying the log (formerly exclusive console) will no longer block other consoles. New messages appear on the other consoles while the newly added console is still replaying. Signed-off-by: John Ogness <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Signed-off-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 1fc0ca9 commit a699449

File tree

2 files changed

+230
-213
lines changed

2 files changed

+230
-213
lines changed

include/linux/console.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ struct console {
151151
int cflag;
152152
uint ispeed;
153153
uint ospeed;
154+
u64 seq;
155+
unsigned long dropped;
154156
void *data;
155157
struct console *next;
156158
};

0 commit comments

Comments
 (0)