Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755349Ab0KMWxd (ORCPT ); Sat, 13 Nov 2010 17:53:33 -0500 Received: from casper.infradead.org ([85.118.1.10]:51984 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754348Ab0KMWxb convert rfc822-to-8bit (ORCPT ); Sat, 13 Nov 2010 17:53:31 -0500 Subject: Re: Kernel rwlock design, Multicore and IGMP From: Peter Zijlstra To: Cypher Wu Cc: Eric Dumazet , linux-kernel@vger.kernel.org, netdev In-Reply-To: References: <1289489007.17691.1310.camel@edumazet-laptop> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Date: Sat, 13 Nov 2010 23:53:46 +0100 Message-ID: <1289688826.2109.400.camel@laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 859 Lines: 23 On Fri, 2010-11-12 at 11:32 +0800, Cypher Wu wrote: > It seems not a problem that read_lock() can be nested or not since > rwlock doesn't have 'owner', You're mistaken. > it's just that should we give > write_lock() a priority than read_lock() since if there have a lot > read_lock()s then they'll starve write_lock(). We rely on that behaviour. FWIW write preference locks will starve readers. > We should work out a well defined behavior so all the > platform-dependent raw_rwlock has to design under that principle. We have that, all archs have read preference rwlock_t, they have to, code relies on it. -- 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/