Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1724305 > unrolled thread
| Started by | Sebastian Andrzej Siewior <bigeasy@linutronix.de> |
|---|---|
| First post | 2017-08-31 17:00 +0200 |
| Last post | 2017-09-02 16:00 +0200 |
| Articles | 3 — 3 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.
Possible BT deadlock due to recursive read locking (Was: Re: kernel BUG at kernel/locking/rtmutex.c:1059) Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2017-08-31 17:00 +0200
Re: Possible BT deadlock due to recursive read locking (Was: Re: kernel BUG at kernel/locking/rtmutex.c:1059) Mart van de Wege <mvdwege@gmail.com> - 2017-09-01 11:00 +0200
Re: Possible BT deadlock due to recursive read locking (Was: Re: kernel BUG at kernel/locking/rtmutex.c:1059) Mart van de Wege <mvdwege@mail.com> (by way of Mart van de Wege <mvdwege@gmail.com>) - 2017-09-02 16:00 +0200
| From | Sebastian Andrzej Siewior <bigeasy@linutronix.de> |
|---|---|
| Date | 2017-08-31 17:00 +0200 |
| Subject | Possible BT deadlock due to recursive read locking (Was: Re: kernel BUG at kernel/locking/rtmutex.c:1059) |
| Message-ID | <ukz6O-6TE-25@gated-at.bofh.it> |
On 2017-08-30 23:25:53 [+0200], Mart van de Wege wrote:
> Hi,
Hi,
> The issue persists up to v4.11.12-rt10
Does
CONFIG_RWLOCK_RT_READER_BIASED=y
make it go away?
> Stacktrace:
>
> Aug 29 17:28:04 localhost kernel: [ 46.483810] ------------[ cut here ]------------
> Aug 29 17:28:04 localhost kernel: [ 46.483812] kernel BUG at kernel/locking/rtmutex.c:1059!
this is a deadlock on RT however !RT has a hidden problem which not
yelled at by lockdep. We have the following call path:
| hci_send_monitor_ctrl_event()
| read_lock(&hci_sk_list.lock);
|
| hci_send_to_channel()
| read_lock(&hci_sk_list.lock);
So both functions acquire the same read_lock. If a write comes along
between the first read_lock() and second read_lock() then we have a
deadlock because the write_lock() will lock down further readers from
acquiring the read-lock until the writer completed its task.
This recursive locking was introduced in 38ceaa00d02d ("Bluetooth: Add
support for sending MGMT commands and events to monitor").
Sebastian
[toc] | [next] | [standalone]
| From | Mart van de Wege <mvdwege@gmail.com> |
|---|---|
| Date | 2017-09-01 11:00 +0200 |
| Subject | Re: Possible BT deadlock due to recursive read locking (Was: Re: kernel BUG at kernel/locking/rtmutex.c:1059) |
| Message-ID | <ukPXY-1xv-23@gated-at.bofh.it> |
| In reply to | #1724305 |
On Thu, 31 Aug 2017 16:52:12 +0200
Sebastian Andrzej Siewior <bigeasy@linutronix.de> wrote:
> On 2017-08-30 23:25:53 [+0200], Mart van de Wege wrote:
> > Hi,
> Hi,
>
> > The issue persists up to v4.11.12-rt10
> Does
> CONFIG_RWLOCK_RT_READER_BIASED=y
> make it go away?
>
Yes, that does make it go away. -rt8 now boots cleanly, and works fine.
Building -rt10 now to be sure.
> > Stacktrace:
> >
> > Aug 29 17:28:04 localhost kernel: [ 46.483810] ------------[ cut
> > here ]------------ Aug 29 17:28:04 localhost kernel: [ 46.483812]
> > kernel BUG at kernel/locking/rtmutex.c:1059!
>
> this is a deadlock on RT however !RT has a hidden problem which not
> yelled at by lockdep. We have the following call path:
>
> | hci_send_monitor_ctrl_event()
> | read_lock(&hci_sk_list.lock);
> |
> | hci_send_to_channel()
> | read_lock(&hci_sk_list.lock);
>
> So both functions acquire the same read_lock. If a write comes along
> between the first read_lock() and second read_lock() then we have a
> deadlock because the write_lock() will lock down further readers from
> acquiring the read-lock until the writer completed its task.
>
> This recursive locking was introduced in 38ceaa00d02d ("Bluetooth: Add
> support for sending MGMT commands and events to monitor").
>
> Sebastian
[toc] | [prev] | [next] | [standalone]
| From | Mart van de Wege <mvdwege@mail.com> (by way of Mart van de Wege <mvdwege@gmail.com>) |
|---|---|
| Date | 2017-09-02 16:00 +0200 |
| Subject | Re: Possible BT deadlock due to recursive read locking (Was: Re: kernel BUG at kernel/locking/rtmutex.c:1059) |
| Message-ID | <ulh7Q-3Ed-9@gated-at.bofh.it> |
| In reply to | #1724889 |
On Fri, 1 Sep 2017 10:51:07 +0200 Mart van de Wege <mvdwege@gmail.com> wrote: > On Thu, 31 Aug 2017 16:52:12 +0200 > Sebastian Andrzej Siewior <bigeasy@linutronix.de> wrote: > > > On 2017-08-30 23:25:53 [+0200], Mart van de Wege wrote: > > > Hi, > > Hi, > > > > > The issue persists up to v4.11.12-rt10 > > Does > > CONFIG_RWLOCK_RT_READER_BIASED=y > > make it go away? > > > Yes, that does make it go away. -rt8 now boots cleanly, and works > fine. Building -rt10 now to be sure. > Confirm that as of 4.11.12-rt11 the deadlock still goes away when enabling CONFIG_RWLOCK_RT_READER_BIASED Mart
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web