Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756290AbZDVPnX (ORCPT ); Wed, 22 Apr 2009 11:43:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752547AbZDVPnE (ORCPT ); Wed, 22 Apr 2009 11:43:04 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:36147 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751738AbZDVPnB (ORCPT ); Wed, 22 Apr 2009 11:43:01 -0400 Date: Wed, 22 Apr 2009 08:32:08 -0700 (PDT) From: Linus Torvalds X-X-Sender: torvalds@localhost.localdomain To: Stephen Hemminger cc: Ingo Molnar , Paul Mackerras , paulmck@linux.vnet.ibm.com, Eric Dumazet , Evgeniy Polyakov , David Miller , 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, mathieu.desnoyers@polymtl.ca Subject: Re: [PATCH] netfilter: use per-cpu recursive lock (v13) In-Reply-To: <20090421143927.52d7d89d@nehalam> Message-ID: References: <20090418094001.GA2369@ioremap.net> <20090418141455.GA7082@linux.vnet.ibm.com> <20090420103414.1b4c490f@nehalam> <49ECBE0A.7010303@cosmosbay.com> <18924.59347.375292.102385@cargo.ozlabs.ibm.com> <20090420215827.GK6822@linux.vnet.ibm.com> <18924.64032.103954.171918@cargo.ozlabs.ibm.com> <20090420160121.268a8226@nehalam> <20090421111541.228e977a@nehalam> <20090421193924.GA24404@elte.hu> <20090421143927.52d7d89d@nehalam> User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1380 Lines: 35 On Tue, 21 Apr 2009, Stephen Hemminger wrote: > > This version of x_tables (ip/ip6/arp) locking uses a per-cpu > recursive lock that can be nested. Ack on the code. But the comment is _still_ crap. Please update. It's not a recursive lock, as clearly shown by the code itself. It's a per-cpu read-write lock, and only the reader is "recursive" (but that's how read-write locks with in Linux, and that has nothing to do with anything). So make the explanations match the code and the intent. Write it something like This version of x_tables (ip/ip6/arp) locking uses a per-cpu reader-writer lock lock where the readers can nest. and don't confuse it with incorrect commit messages. The lock is very much not recursive - on purpose - for half the people taking it. [ That, btw, was always true, even in the original random open-coded version. Because you can't actually do a real recursive lock without having notion of "current ownership" either by making the count be - like the BKL - or by saving the ownership information in the lock. A plain counter simply doesn't do it. ] Linus -- 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/