Originally posted by cj.wijtmans
View Post
https://lore.kernel.org/lkml/2022091...linutronix.de/ is a good read spotting the key warning about the existing simple is simple to miss.
1) The blurry semantics of console lock which triggers unpleasant memories of BKL. That in turn inspired me to flag the new consoles
with CON_NOBKL and use the nobkl theme throughout the series as I could not come up with a better name.
2) The assumption that seperating a printk thread out from console lock, but at the same time partially depending on console lock. That's not
really working out.
3) The operation of consoles and printk threads was depending solely on global state and that state is on/off so it does not really qualify as
stateful and is therefore not really useful to create a stable mechanism.
with CON_NOBKL and use the nobkl theme throughout the series as I could not come up with a better name.
2) The assumption that seperating a printk thread out from console lock, but at the same time partially depending on console lock. That's not
really working out.
3) The operation of consoles and printk threads was depending solely on global state and that state is on/off so it does not really qualify as
stateful and is therefore not really useful to create a stable mechanism.
In fact there is not a single regular (non-early) console driver today which is reentrancy safe under all circumstances, which enforces that NMI context is excluded from printing directly. TBH, that's a sad state of affairs.
The reality we already have a lot of console bugs. It very possible that going to a full thread console without locks will remove a lot of bugs. Latency issue exists already with the existing console. The RT kernel mode of Linux issue with the existing is the amount of latency you spend getting console messages from one CPU core to another due to locking.
Console Threads done with better IPC can be better performance than the existing Console code. Remove the locks you remove dead locking.. Console dead locking is a really bad thing.
The new attempt at threaded Console kind of deceptive. The reality is the Linux kernel has thread console already based heavily on locking. As in you need to take out console lock before you can do anything.
All console state operations rely solely on atomic*_try_cmpxchg() so they work in any context.
Originally posted by cj.wijtmans
View Post
Having a threaded console is not new to Linux. The current console design in the linux kernel at core goes back to 0.1 Linux as in 1991. Atomic operations did not exist in CPUs of that time. Yes the i386. Linux kernel removed the BKL but has kept the global console lock.
Mixture of single threaded/multi threaded that using locks cause is normally a very bad thing. Particularly when we have had atomic since the i486.
The current Linux console is broken. The new threaded console design could fix lots of broken.
Lot of ways for normal people to understand is not to call this change "threaded console printing" but remove of the "Console Big Kernel Lock" so change over to using atomic between console threads correctly to bring robustness and performance.
Yes just like the migrating away from the "Big Kernel Lock" there is going to be a few issues here or there but long term removal of the "Console Big Kernel Lock" will be gain.
There are likely other per subsystem "Big Kernel Lock" replacements that need to be exterminated like the "Console Big Kernel Lock" still in the Linux kernel.
Yes you could also class this patch set as attempting to complete "Big Kernel Lock removal" as well.
Leave a comment: