From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [net-next, v6, 6/7] net-sysfs: Add interface for Rx queue(s) map per Tx queue Date: Thu, 19 Jul 2018 11:16:07 +0200 Message-ID: <20180719091607.GZ2494@hirez.programming.kicks-ass.net> References: <153033282719.8297.790755582693609184.stgit@anamhost.jf.intel.com> <20180704072048.GA29107@outlook.office365.com> <4b7f5d42-1b81-f095-f313-f43e41cf8601@intel.com> <20180718182235.GA28548@outlook.office365.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "Nambiar, Amritha" , Ingo Molnar , netdev@vger.kernel.org, davem@davemloft.net, alexander.h.duyck@intel.com, willemdebruijn.kernel@gmail.com, sridhar.samudrala@intel.com, alexander.duyck@gmail.com, edumazet@google.com, hannes@stressinduktion.org, tom@herbertland.com, tom@quantonium.net, jasowang@redhat.com, gaowanlong@cn.fujitsu.com To: Andrei Vagin Return-path: Received: from bombadil.infradead.org ([198.137.202.133]:39284 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726494AbeGSJ6g (ORCPT ); Thu, 19 Jul 2018 05:58:36 -0400 Content-Disposition: inline In-Reply-To: <20180718182235.GA28548@outlook.office365.com> Sender: netdev-owner@vger.kernel.org List-ID: On Wed, Jul 18, 2018 at 11:22:36AM -0700, Andrei Vagin wrote: > > > [ 1.085679] lock(cpu_hotplug_lock.rw_sem); > > > [ 1.085753] lock(cpu_hotplug_lock.rw_sem); > > > [ 1.085828] > > > [ 1.085828] *** DEADLOCK *** > Peter and Ingo, maybe you could explain why it isn't safe to take one > reader lock twice? Very simple, because rwsems are fair and !recursive. So if another CPU were to issue a write-lock in between these, then the second would block because there is a writer pending. But because we then already have a reader we're deadlocked.