Re: [debug patch] printk: Add a printk killswitch to robustify NMI watchdog messages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2011-06-06 at 18:44 +0200, Peter Zijlstra wrote:
>  
> @@ -942,25 +953,13 @@ asmlinkage int vprintk(const char *fmt, va_list args)
>                 if (*p == '\n')
>                         new_text_line = 1;
>         }
> +       spin_unlock(&logbuf_lock);
>  
> -       /*
> -        * Try to acquire and then immediately release the
> -        * console semaphore. The release will do all the
> -        * actual magic (print out buffers, wake up klogd,
> -        * etc). 
> -        *
> -        * The console_trylock_for_printk() function
> -        * will release 'logbuf_lock' regardless of whether it
> -        * actually gets the semaphore or not.
> -        */
> -       if (console_trylock_for_printk(this_cpu))
> -               console_unlock(); 

FWIW the existing printk recursion logic is broken, console_unlock()
clears printk_cpu but console_trylock_for_printk() can release
logbuf_lock and fail the trylock of console_sem, in which case a
subsequent printk() is perfectly valid and non-recursing.


--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux