Re: linux.git: printk() problem

From: Sergey Senozhatsky
Date: Mon Oct 24 2016 - 10:24:42 EST


> On (10/23/16 12:46), Linus Torvalds wrote:
> > +static void deferred_cont_flush(void)
> > +{
> > + static DEFINE_TIMER(timer, flush_timer, 0, 0);
> > +
> > + if (!cont.len)
> > return;
> > + mod_timer(&timer, jiffies + HZ/10);
> > }
>
> [..]
>
> > @@ -2360,6 +2285,8 @@ void console_unlock(void)
> > return;
> > }
> >
> > + deferred_cont_flush();
> > +
>

[ 0.000000] BUG: spinlock bad magic on CPU#0, swapper/0
[ 0.000000] lock: __init_begin+0x1cebc0/0x1da000, .magic: 00000000, .owner: swapper/0, .owner_cpu: 0
[ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 4.9.0-rc1-next-20161024-dbg-dirty #150
[ 0.000000] ffffffff81803c18 ffffffff81221216 ffffffff8180a540 ffffffff81ac7bc0
[ 0.000000] ffffffff81803c38 ffffffff81081414 ffffffff81ac7bc0 0000000000000046
[ 0.000000] ffffffff81803c58 ffffffff81081444 ffffffff81ac7bc0 ffffffff81737e85
[ 0.000000] Call Trace:
[ 0.000000] [<ffffffff81221216>] dump_stack+0x4f/0x65
[ 0.000000] [<ffffffff81081414>] spin_dump+0x8a/0x8f
[ 0.000000] [<ffffffff81081444>] spin_bug+0x2b/0x2d
[ 0.000000] [<ffffffff81081604>] do_raw_spin_unlock+0x22/0x81
[ 0.000000] [<ffffffff814b145a>] _raw_spin_unlock_irqrestore+0x2c/0x4e
[ 0.000000] [<ffffffff81097974>] mod_timer+0x266/0x2a0
[ 0.000000] [<ffffffff81084f14>] deferred_cont_flush+0x2a/0x2c
[ 0.000000] [<ffffffff81086092>] console_unlock+0x28/0x45c
[ 0.000000] [<ffffffff8108686c>] ? vprintk_emit+0x3a6/0x3c5
[ 0.000000] [<ffffffff81086875>] vprintk_emit+0x3af/0x3c5
[ 0.000000] [<ffffffff810869f7>] vprintk_default+0x1d/0x1f
[ 0.000000] [<ffffffff810ecb95>] printk+0x48/0x50
[ 0.000000] [<ffffffff810869f7>] ? vprintk_default+0x1d/0x1f
[ 0.000000] [<ffffffff81adb082>] e820_print_map+0x4a/0x70
[ 0.000000] [<ffffffff81000000>] ? 0xffffffff81000000
[ 0.000000] [<ffffffff81adbbc4>] setup_memory_map+0x37/0x3a
[ 0.000000] [<ffffffff81ad9264>] setup_arch+0x16d/0x890
[ 0.000000] [<ffffffff81ad3b9c>] start_kernel+0x59/0x40c
[ 0.000000] [<ffffffff81ad328e>] x86_64_start_reservations+0x2a/0x2c
[ 0.000000] [<ffffffff81ad340a>] x86_64_start_kernel+0x17a/0x18d
[ 0.000000] [<ffffffff810001a5>] start_cpu+0x5/0x14
[ 0.000000] [<ffffffff810001a5>] ? start_cpu+0x5/0x14
[ 0.000000] usable

-ss