Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1652407 > unrolled thread

Re: [linux-next / tty] possible circular locking dependency detected

Started byVegard Nossum <vegard.nossum@oracle.com>
First post2017-05-29 12:50 +0200
Last post2017-06-03 23:00 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [linux-next / tty] possible circular locking dependency detected Vegard Nossum <vegard.nossum@oracle.com> - 2017-05-29 12:50 +0200
    Re: [linux-next / tty] possible circular locking dependency detected Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-03 16:20 +0200
      Re: [linux-next / tty] possible circular locking dependency detected Vegard Nossum <vegard.nossum@oracle.com> - 2017-06-03 23:00 +0200

#1652407 — Re: [linux-next / tty] possible circular locking dependency detected

FromVegard Nossum <vegard.nossum@oracle.com>
Date2017-05-29 12:50 +0200
SubjectRe: [linux-next / tty] possible circular locking dependency detected
Message-ID<tMqpk-72M-9@gated-at.bofh.it>
On 05/22/17 12:27, Vegard Nossum wrote:
> On 05/22/17 12:24, Greg Kroah-Hartman wrote:
>> On Mon, May 22, 2017 at 04:39:43PM +0900, Sergey Senozhatsky wrote:
>>> Hello,
>>>
>>> [ 1274.378287] ======================================================
>>> [ 1274.378289] WARNING: possible circular locking dependency detected
>>> [ 1274.378290] 4.12.0-rc1-next-20170522-dbg-00007-gc09b2ab28b74-dirty 
>>> #1317 Not tainted
>>> [ 1274.378291] ------------------------------------------------------
>>> [ 1274.378293] kworker/u8:5/111 is trying to acquire lock:
>>> [ 1274.378294]  (&buf->lock){+.+...}, at: [<ffffffff812f2831>] 
>>> tty_buffer_flush+0x34/0x88
>>> [ 1274.378300]
>>>                 but task is already holding lock:
>>> [ 1274.378301]  (&o_tty->termios_rwsem/1){++++..}, at: 
>>> [<ffffffff812ee5c7>] isig+0x47/0xd2
>>> [ 1274.378307]
>>>                 which lock already depends on the new lock.
>>>
> 
>> Any hint as to what you were doing when this happened?
>>
>> Does this also show up in 4.11?
> 
> It's my patch "tty: fix port buffer locking" :-/
> 
> At a glance, looks related to pty taking the lock on the other side in a
> different order. I'll have a closer look.

I can reproduce the lockdep report locally on v4.12-rc3. Looking at it now.


Vegard

[toc] | [next] | [standalone]


#1656833

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-06-03 16:20 +0200
Message-ID<tOi4i-850-31@gated-at.bofh.it>
In reply to#1652407
On Mon, May 29, 2017 at 12:43:39PM +0200, Vegard Nossum wrote:
> On 05/22/17 12:27, Vegard Nossum wrote:
> > On 05/22/17 12:24, Greg Kroah-Hartman wrote:
> > > On Mon, May 22, 2017 at 04:39:43PM +0900, Sergey Senozhatsky wrote:
> > > > Hello,
> > > > 
> > > > [ 1274.378287] ======================================================
> > > > [ 1274.378289] WARNING: possible circular locking dependency detected
> > > > [ 1274.378290]
> > > > 4.12.0-rc1-next-20170522-dbg-00007-gc09b2ab28b74-dirty #1317 Not
> > > > tainted
> > > > [ 1274.378291] ------------------------------------------------------
> > > > [ 1274.378293] kworker/u8:5/111 is trying to acquire lock:
> > > > [ 1274.378294]  (&buf->lock){+.+...}, at: [<ffffffff812f2831>]
> > > > tty_buffer_flush+0x34/0x88
> > > > [ 1274.378300]
> > > >                 but task is already holding lock:
> > > > [ 1274.378301]  (&o_tty->termios_rwsem/1){++++..}, at:
> > > > [<ffffffff812ee5c7>] isig+0x47/0xd2
> > > > [ 1274.378307]
> > > >                 which lock already depends on the new lock.
> > > > 
> > 
> > > Any hint as to what you were doing when this happened?
> > > 
> > > Does this also show up in 4.11?
> > 
> > It's my patch "tty: fix port buffer locking" :-/
> > 
> > At a glance, looks related to pty taking the lock on the other side in a
> > different order. I'll have a closer look.
> 
> I can reproduce the lockdep report locally on v4.12-rc3. Looking at it now.

Any ideas?  Or should I just revert the original patch?

thanks,

greg k-h

[toc] | [prev] | [next] | [standalone]


#1656925

FromVegard Nossum <vegard.nossum@oracle.com>
Date2017-06-03 23:00 +0200
Message-ID<tOojp-3mt-37@gated-at.bofh.it>
In reply to#1656833
On 06/03/17 11:34, Greg Kroah-Hartman wrote:
> On Mon, May 29, 2017 at 12:43:39PM +0200, Vegard Nossum wrote:
>> On 05/22/17 12:27, Vegard Nossum wrote:
>>> On 05/22/17 12:24, Greg Kroah-Hartman wrote:
>>>> On Mon, May 22, 2017 at 04:39:43PM +0900, Sergey Senozhatsky wrote:
>>>>> Hello,
>>>>>
>>>>> [ 1274.378287] ======================================================
>>>>> [ 1274.378289] WARNING: possible circular locking dependency detected
>>>>> [ 1274.378290]
>>>>> 4.12.0-rc1-next-20170522-dbg-00007-gc09b2ab28b74-dirty #1317 Not
>>>>> tainted
>>>>> [ 1274.378291] ------------------------------------------------------
>>>>> [ 1274.378293] kworker/u8:5/111 is trying to acquire lock:
>>>>> [ 1274.378294]  (&buf->lock){+.+...}, at: [<ffffffff812f2831>]
>>>>> tty_buffer_flush+0x34/0x88
>>>>> [ 1274.378300]
>>>>>                  but task is already holding lock:
>>>>> [ 1274.378301]  (&o_tty->termios_rwsem/1){++++..}, at:
>>>>> [<ffffffff812ee5c7>] isig+0x47/0xd2
>>>>> [ 1274.378307]
>>>>>                  which lock already depends on the new lock.
>>>>>
>>>
>>>> Any hint as to what you were doing when this happened?
>>>>
>>>> Does this also show up in 4.11?
>>>
>>> It's my patch "tty: fix port buffer locking" :-/
>>>
>>> At a glance, looks related to pty taking the lock on the other side in a
>>> different order. I'll have a closer look.
>>
>> I can reproduce the lockdep report locally on v4.12-rc3. Looking at it now.
> 
> Any ideas?  Or should I just revert the original patch?

I think we must revert it for now, as I can easily reproduce not just
the lockdep warning but actual hangs. It seems I missed some code paths
when I worked the original patch.

I'm working on a fix.


Vegard

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web