Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752418AbaBKDkS (ORCPT ); Mon, 10 Feb 2014 22:40:18 -0500 Received: from gate.crashing.org ([63.228.1.57]:46960 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752186AbaBKDkP (ORCPT ); Mon, 10 Feb 2014 22:40:15 -0500 Message-ID: <1392089915.3996.60.camel@pasglop> Subject: Re: [PATCH v2] powerpc ticket locks From: Benjamin Herrenschmidt To: Al Viro Cc: Torsten Duwe , Paul Mackerras , Anton Blanchard , "Paul E. McKenney" , Peter Zijlstra , Scott Wood , Tom Musta , Ingo Molnar , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Linus Torvalds Date: Tue, 11 Feb 2014 14:38:35 +1100 In-Reply-To: <20140211025645.GJ18016@ZenIV.linux.org.uk> References: <20140207165801.GC2107@lst.de> <1392001823.3996.21.camel@pasglop> <20140210155217.GF2107@lst.de> <1392086660.3996.50.camel@pasglop> <20140211025645.GJ18016@ZenIV.linux.org.uk> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.8.4-0ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2014-02-11 at 02:56 +0000, Al Viro wrote: > > So the question is, is it reasonable to have the ref smaller than > > 32-bit... > > Every time you open a file, you bump dentry refcount. Something like > libc or ld.so will be opened on just about every execve(), so I'd say > that 16 bits is far too low. If nothing else, 32 bits might be too > low on 64bit boxen... So back to square 1 ... we can't implement together lockref, ticket locks, and our lock confer mechanism within 64-bit. I see two options at this stage. Both require a custom implementation of lockref for powerpc, so some ifdef's such that we can replace the generic implementation completely. - We can use a small ref, and when it's too big, overflow into a larger one, falling back to the "old style" lock + ref (an overflow bit or a compare with ffff) - We can have lockref "build" it's own lock out of the ticketpair and ref, keeping the owner in a separate word. The owner doesn't strictly need to be atomic. Both are gross though :( Anybody has a better idea ? Ben. -- 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/