From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752674AbcEGLoA (ORCPT ); Sat, 7 May 2016 07:44:00 -0400 Received: from www.linutronix.de ([62.245.132.108]:33598 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932095AbcEGLmm (ORCPT ); Sat, 7 May 2016 07:42:42 -0400 Date: Sat, 7 May 2016 13:40:57 +0200 (CEST) From: Thomas Gleixner To: Darren Hart cc: LKML , Sebastian Andrzej Siewior , Linus Torvalds , Darren Hart , Peter Zijlstra , Ingo Molnar , Michael Kerrisk , Davidlohr Bueso , Chris Mason , "Carlos O'Donell" , Torvald Riegel , Eric Dumazet Subject: Re: [patch V2 3/7] futex: Add op for hash preallocation In-Reply-To: Message-ID: References: <20160505204230.932454245@linutronix.de> <20160505204354.051976225@linutronix.de> <20160506181843.GF48432@f23x64.localdomain> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 7 May 2016, Thomas Gleixner wrote: > On Fri, 6 May 2016, Darren Hart wrote: > > > Note, that this call must be issued before the first futex operation in the > > > process because that would automatically allocate the default sized hash. > > > > So this seems like it could be tricky for the user as system libraries, like > > glibc, make use of futexes. Can we guarantee that "sys_futex" is not called by > > the time main() is called? > > To the extent of my testing I never observed that the hash was automatically > created when I called futex(PREALLOC) right away in main. But yes, that might > need some thought. Thinking more about it. If a process is single threaded and it definitely is up to the point where it reaches main(), there is nothing which might cause a sys_futex() call except something which would use shared futexes in the depth of init code. I doubt that this happens, and if it does, then it's some non standard feature^Whackery which I do not care about at all. Thanks, tglx