Re: net: deadlock on genl_mutex

From: Cong Wang
Date: Fri Dec 09 2016 - 00:09:12 EST


On Thu, Dec 8, 2016 at 4:32 PM, Cong Wang <xiyou.wangcong@xxxxxxxxx> wrote:
> On Thu, Dec 8, 2016 at 9:16 AM, Dmitry Vyukov <dvyukov@xxxxxxxxxx> wrote:
>> Chain exists of:
>> Possible unsafe locking scenario:
>>
>> CPU0 CPU1
>> ---- ----
>> lock(genl_mutex);
>> lock(nlk->cb_mutex);
>> lock(genl_mutex);
>> lock(rtnl_mutex);
>>
>> *** DEADLOCK ***
>
> This one looks legitimate, because nlk->cb_mutex could be rtnl_mutex.
> Let me think about it.

Never mind. Actually both reports in this thread are legitimate.

I know what happened now, the lock chain is so long, 4 locks are involved
to form a chain!!!

Let me think about how to break the chain.