Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755016AbZDZWhs (ORCPT ); Sun, 26 Apr 2009 18:37:48 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753275AbZDZWhU (ORCPT ); Sun, 26 Apr 2009 18:37:20 -0400 Received: from tomts16.bellnexxia.net ([209.226.175.4]:55783 "EHLO tomts16-srv.bellnexxia.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753505AbZDZWhQ (ORCPT ); Sun, 26 Apr 2009 18:37:16 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqEFAIh59ElMQW1W/2dsb2JhbACBUMhzg3QF Date: Sun, 26 Apr 2009 18:32:11 -0400 From: Mathieu Desnoyers To: Stephen Hemminger Cc: Eric Dumazet , David Miller , Jarek Poplawski , Linus Torvalds , Ingo Molnar , Paul Mackerras , paulmck@linux.vnet.ibm.com, Evgeniy Polyakov , kaber@trash.net, jeff.chua.linux@gmail.com, laijs@cn.fujitsu.com, jengelh@medozas.de, r000n@r000n.net, linux-kernel@vger.kernel.org, netfilter-devel@vger.kernel.org, netdev@vger.kernel.org, benh@kernel.crashing.org, Thomas Gleixner , Steven Rostedt Subject: Re: [PATCH] netfilter: use per-CPU recursive lock {XV} Message-ID: <20090426223211.GB825@Krystal> References: <20090421143927.52d7d89d@nehalam> <20090423210938.1501507b@nehalam> <49F146FF.5050200@cosmosbay.com> <20090424091839.6e13ebec@nehalam> <49F22465.80305@gmail.com> <20090425133052.4cb711f5@nehalam> <49F4A6E3.7080102@cosmosbay.com> <20090426185646.GB29238@Krystal> <20090426145746.1184aeba@nehalam> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline In-Reply-To: <20090426145746.1184aeba@nehalam> X-Editor: vi X-Info: http://krystal.dyndns.org:8080 X-Operating-System: Linux/2.6.21.3-grsec (i686) X-Uptime: 18:08:03 up 57 days, 18:34, 2 users, load average: 0.16, 0.22, 0.20 User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3138 Lines: 80 * Stephen Hemminger (shemminger@vyatta.com) wrote: > On Sun, 26 Apr 2009 14:56:46 -0400 > Mathieu Desnoyers wrote: > > > * Eric Dumazet (dada1@cosmosbay.com) wrote: > > > From: Stephen Hemminger > > > > > > > Epilogue due to master Jarek. Lockdep carest not about the locking > > > > doth bestowed. Therefore no keys are needed. > > > > > > > > Signed-off-by: Stephen Hemminger > > > > > > So far, so good, should be ready for inclusion now, nobody complained :) > > > > > > I include the final patch, merge of your last two patches. > > > > > > David, could you please review it once again and apply it if it's OK ? > > > > > Thanks to all for your help and patience > > > > > > [PATCH] netfilter: use per-CPU recursive lock {XV} > > > > Hi Eric, > > > > Suitable name would probably be : > > Hi Stephen, [I see that you have cutted my name proposal from the original email, which might make it difficult for others to follow. I will assume you did it by mistake.] (re-added) [PATCH] netfilter: use bh disabling with per-cpu read-write lock > > But Linus is trying to delude himself. > > This usage is recursive even if he doesn't like the terminology. > The same CPU has to be able to reacquire the read lock without deadlocking. > If reader/writer locks were implemented in a pure writer gets priority > method, then this code would break! So yes read locks can be used recursively > now in Linux, but if the were implemented differently then this code > would break. For example, the -rt kernel turns all read/write locks into > mutexs, so the -rt kernel developers will have to address this. Reading Documentation/spinlocks.txt, which states the lock usage guidelines : "Note that you can be clever with read-write locks and interrupts. For example, if you know that the interrupt only ever gets a read-lock, then you can use a non-irq version of read locks everywhere - because they don't block on each other (and thus there is no dead-lock wrt interrupts. But when you do the write-lock, you have to use the irq-safe version." So it's assumed in the kernel-wide read lock usage that nested read locks are OK. I'm adding Thomas and Steven in CC, but I'm quite sure they must have dealt with nested read-lock transformation into mutexes by detecting nesting in some way in -rt. But I'll let them confirm this. So I don't see why you are dreaming about a different semantic than the one of the primitives you are using. I guess I'll leave the semantics to you. I just find it astonishing that you persist saying that everbody is wrong on a topic like semantic, which is in the end a mean to communicate ideas clearly within the overall community you disagree with. Good luck ! Mathieu -- Mathieu Desnoyers OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/