• Ingo Molnar's avatar
    printk: make printk more robust by not allowing recursion · 32a76006
    Ingo Molnar authored
    make printk more robust by allowing recursion only if there's a crash
    going on. Also add recursion detection.
    
    I've tested it with an artificially injected printk recursion - instead
    of a lockup or spontaneous reboot or other crash, the output was a well
    controlled:
    
    [   41.057335] SysRq : <2>BUG: recent printk recursion!
    [   41.057335] loglevel0-8 reBoot Crashdump show-all-locks(D) tErm Full kIll saK showMem Nice powerOff showPc show-all-timers(Q) unRaw Sync showTasks Unmount shoW-blocked-tasks
    
    also do all this printk-debug logic with irqs disabled.
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    Reviewed-by: default avatarNick Piggin <npiggin@suse.de>
    32a76006
printk.c 32.5 KB