lkml.org 
[lkml]   [2011]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [debug patch] printk: Add a printk killswitch to robustify NMI watchdog messages
From
Date
On Mon, 2011-06-06 at 18:44 +0200, Peter Zijlstra wrote:
> +void printk_tick(void)
> +{
> + if (!__this_cpu_read(printk_pending))
> + return;
> +
> + /*
> + * 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).
> + */
> + if (console_trylock_for_printk(smp_processor_id())) {
> + console_unlock();
> + __this_cpu_write(printk_pending, 0);
> + }
> +}

Aside from not compiling (someone stuck a ref to wake_up_klogd somewhere
in lib/) this does delay the whole of printk() output by up to a jiffy,
if the machine dies funny you could be missing large parts of the
output :/




\
 
 \ /
  Last update: 2011-06-06 18:53    [W:0.190 / U:0.836 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site