linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Dmitry Vyukov <dvyukov@google.com>
Cc: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>,
	Ingo Molnar <mingo@redhat.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>, LKML <linux-kernel@vger.kernel.org>,
	J Freyensee <james_p_freyensee@linux.intel.com>,
	syzkaller <syzkaller@googlegroups.com>,
	Kostya Serebryany <kcc@google.com>,
	Alexander Potapenko <glider@google.com>,
	Sasha Levin <sasha.levin@oracle.com>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: tty: deadlock between n_tracerouter_receivebuf and flush_to_ldisc
Date: Wed, 20 Jan 2016 13:07:52 +0100	[thread overview]
Message-ID: <20160120120752.GQ3421@worktop> (raw)
In-Reply-To: <CACT4Y+YMK=fh0G-qL7d8zpop9iNzKKwE3F0HKgjiPTsXXNbp0w@mail.gmail.com>

On Wed, Jan 20, 2016 at 12:54:55PM +0100, Dmitry Vyukov wrote:
> On Wed, Jan 20, 2016 at 12:44 PM, Peter Zijlstra <peterz@infradead.org> wrote:
> > On Wed, Jan 20, 2016 at 10:36:01AM +0100, Dmitry Vyukov wrote:
> >
> >> +Peter, Ingo, can you please suggest a way to annotate this locking
> >> pattern to avoid lockdep false positive?
> >
> > No, because I haven't a clue what the actual problem is.
> >
> > The report is fairly clear on how:
> >
> >  routelock
> >    &port->buf.lock/1
> >      &o_tty->termios_rwsem/1
> >        &buf->lock
> >
> > gets established, and shows where we try:
> >
> >   &buf->lock
> >     routelock
> >
> > Which gives a circle, ergo deadlock.
> >
> > Show which link is wrong and why, and I can suggest ways of annotating
> > that.
> 
> 
> Alan provided an explanation calling this "false report":
> https://groups.google.com/d/msg/syzkaller/YrV0bzdfa-g/cCVoUf1OFQAJ

I read that, I didn't understand it. Which link is wrong and why?

> And I don't understand how the following is a deadlock, since there is
> no cycle...
> 
>  Possible unsafe locking scenario:
>       CPU0                    CPU1
>        ----                    ----
>   lock(&buf->lock);
>                                lock(&o_tty->termios_rwsem/1);
>                                lock(&buf->lock);
>   lock(routelock);

Ignore the stupid picture, it only really works for simple cases.

  reply	other threads:[~2016-01-20 12:08 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-30 10:44 tty: deadlock between n_tracerouter_receivebuf and flush_to_ldisc Dmitry Vyukov
2016-01-15  7:51 ` Dmitry Vyukov
2016-01-15 16:33   ` One Thousand Gnomes
2016-01-15 17:22     ` Dmitry Vyukov
2016-01-20  9:36       ` Dmitry Vyukov
2016-01-20 11:44         ` Peter Zijlstra
2016-01-20 11:54           ` Dmitry Vyukov
2016-01-20 12:07             ` Peter Zijlstra [this message]
2016-01-20 14:58               ` One Thousand Gnomes
2016-01-20 15:16                 ` Dmitry Vyukov
2016-01-20 16:32                   ` Peter Zijlstra
2016-01-20  2:09     ` J Freyensee
2016-01-20 12:47 ` Jiri Slaby
2016-01-20 13:02 ` Peter Zijlstra
2016-01-20 13:07   ` Dmitry Vyukov
2016-01-20 16:08   ` Peter Hurley
2016-01-20 20:47     ` Peter Hurley
2016-01-21 10:06     ` Dmitry Vyukov
2016-01-21 10:20       ` Peter Zijlstra
2016-01-21 17:51         ` Peter Hurley
2016-01-22 14:10           ` Dmitry Vyukov
2016-01-25 16:56             ` Peter Hurley
2016-01-21 17:43       ` Peter Hurley
2016-02-03  4:24         ` Peter Hurley
2016-02-03 17:32           ` Dmitry Vyukov
2016-02-03 19:09             ` Peter Hurley
2016-02-04 12:39               ` Dmitry Vyukov
2016-02-04 13:17                 ` Dmitry Vyukov
2016-02-04 18:46                   ` Peter Hurley
2016-02-04 18:48                     ` Dmitry Vyukov
2016-02-05 21:22                       ` Dmitry Vyukov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160120120752.GQ3421@worktop \
    --to=peterz@infradead.org \
    --cc=dvyukov@google.com \
    --cc=edumazet@google.com \
    --cc=glider@google.com \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=gregkh@linuxfoundation.org \
    --cc=james_p_freyensee@linux.intel.com \
    --cc=jslaby@suse.com \
    --cc=kcc@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=sasha.levin@oracle.com \
    --cc=syzkaller@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).