From mboxrd@z Thu Jan 1 00:00:00 1970 From: Suresh Siddha Subject: Re: smp.c && barriers (Was: [PATCH 1/4] generic-smp: remove single ipi fallback for smp_call_function_many()) Date: Tue, 17 Feb 2009 18:15:31 -0800 Message-ID: <1234923331.29823.2.camel@vayu> References: <1234818201.30178.386.camel@laptop> <20090216213205.GA9098@redhat.com> <1234820704.30178.396.camel@laptop> <20090216220214.GA10093@redhat.com> <1234823097.30178.406.camel@laptop> <20090216231946.GA12009@redhat.com> <1234862974.4744.31.camel@laptop> <20090217101130.GA8660@wotan.suse.de> <1234866453.4744.58.camel@laptop> <20090217112657.GE26402@wotan.suse.de> <20090217155147.GE6761@linux.vnet.ibm.com> Reply-To: Suresh Siddha Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: Received: from mga03.intel.com ([143.182.124.21]:57576 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752621AbZBRCQ4 (ORCPT ); Tue, 17 Feb 2009 21:16:56 -0500 In-Reply-To: <20090217155147.GE6761@linux.vnet.ibm.com> Sender: linux-arch-owner@vger.kernel.org List-ID: To: "paulmck@linux.vnet.ibm.com" Cc: Nick Piggin , Peter Zijlstra , Oleg Nesterov , Jens Axboe , Linus Torvalds , Ingo Molnar , Rusty Russell , Steven Rostedt , "linux-kernel@vger.kernel.org" , "linux-arch@vger.kernel.org" On Tue, 2009-02-17 at 07:51 -0800, Paul E. McKenney wrote: > On Tue, Feb 17, 2009 at 12:26:57PM +0100, Nick Piggin wrote: > > + spin_lock(&q->lock); > > + list_replace_init(&q->list, &list); > > + spin_unlock(&q->lock); > > OK, I'll bite... > > How do we avoid deadlock in the case where a pair of CPUs send to each > other concurrently? Sender takes the lock with interrupts-disabled. That should prevent any deadlock, right?