lkml.org 
[lkml]   [2017]   [Aug]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: possible circular locking dependency detected [was: linux-next: Tree for Aug 22]
On Wed, Aug 23, 2017 at 01:46:48PM +0900, Sergey Senozhatsky wrote:
> On (08/23/17 12:38), Boqun Feng wrote:
> [..]
> > diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
> > index 642fb5362507..a3709e15f609 100644
> > --- a/kernel/locking/lockdep.c
> > +++ b/kernel/locking/lockdep.c
> > @@ -1156,6 +1156,23 @@ print_circular_lock_scenario(struct held_lock *src,
> > __print_lock_name(target);
> > printk(KERN_CONT ");\n");
>
> KERN_CONT and "\n" should not be together. "\n" flushes the cont
> buffer immediately.
>

Hmm.. Not quite familiar with printk() stuffs, but I could see several
usages of printk(KERN_CONT "...\n") in kernel.

Did a bit research myself, and I now think the inappropriate use is to
use a KERN_CONT printk *after* another printk ending with a "\n". Am I
missing some recent changes or rules of KERN_CONT?

Regards,
Boqun

> -ss
>
> > printk("\n *** DEADLOCK ***\n\n");
> > + } else if (cross_lock(src->instance)) {
> > + printk(" Possible unsafe locking scenario by crosslock:\n\n");
> > + printk(" CPU0 CPU1\n");
> > + printk(" ---- ----\n");
> > + printk(" lock(");
> > + __print_lock_name(target);
> > + printk(KERN_CONT ");\n");
> > + printk(" lock(");
> > + __print_lock_name(source);
> > + printk(KERN_CONT ");\n");
> > + printk(" lock(");
> > + __print_lock_name(parent == source ? target : parent);
> > + printk(KERN_CONT ");\n");
> > + printk(" unlock(");
> > + __print_lock_name(source);
> > + printk(KERN_CONT ");\n");
> > + printk("\n *** DEADLOCK ***\n\n");
> > } else {
> > printk(" Possible unsafe locking scenario:\n\n");
> > printk(" CPU0 CPU1\n");
> > --
> > 2.14.1
> >
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2017-08-23 07:35    [W:0.167 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site