From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751947AbXDKKBu (ORCPT ); Wed, 11 Apr 2007 06:01:50 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751951AbXDKKBu (ORCPT ); Wed, 11 Apr 2007 06:01:50 -0400 Received: from pfx2.jmh.fr ([194.153.89.55]:37651 "EHLO pfx2.jmh.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751947AbXDKKBu (ORCPT ); Wed, 11 Apr 2007 06:01:50 -0400 Date: Wed, 11 Apr 2007 11:35:25 +0200 From: Eric Dumazet To: Nick Piggin Cc: Andrew Morton , Dave Jones , Ulrich Drepper , Ingo Molnar , Andi Kleen , Ravikiran G Thirumalai , "Shai Fultheim (Shai@scalex86.org)" , pravin b shelar , linux-kernel@vger.kernel.org Subject: Re: [PATCH, take4] FUTEX : new PRIVATE futexes Message-Id: <20070411113525.baf8deb0.dada1@cosmosbay.com> In-Reply-To: <461CA90E.3080306@yahoo.com.au> References: <20060808070708.GA3931@localhost.localdomain> <200608090826.28249.dada1@cosmosbay.com> <200608090843.52893.dada1@cosmosbay.com> <200703152010.35614.dada1@cosmosbay.com> <20070405194942.1414c030.dada1@cosmosbay.com> <20070407104339.6674336b.dada1@cosmosbay.com> <461764A6.3080703@yahoo.com.au> <20070407120051.9ed0e69a.dada1@cosmosbay.com> <461C8CD1.3080707@yahoo.com.au> <20070411101458.114125ee.dada1@cosmosbay.com> <461CA90E.3080306@yahoo.com.au> X-Mailer: Sylpheed 2.3.1 (GTK+ 2.10.6; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 11 Apr 2007 19:23:26 +1000 Nick Piggin wrote: > But... that isn't there in mainline. Why is it in -mm? At any rate, that makes > it a no brainer to change. Seems to be related to lguest. Ask Rusty :) > > > > > As this external thing certainly is not doing the check itself, to be on the safe side we should enforce it in get_futex_key(). I agree with you : If we want to maximize performance, we could say : The check *must* be done by the caller. > > Well we _control_ the API, so let's make it as clean and performant as possible > from the start. Take a look at do_futex(). Adding checks in callers just increase code size. I tried this got only bad results. This would speedup only the slow path (ie when some user code want to give us non aligned addrs) A single factorized check is cleaner and not slower, since we reduce icache pressure.