From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752585AbcEGIrk (ORCPT ); Sat, 7 May 2016 04:47:40 -0400 Received: from www.linutronix.de ([62.245.132.108]:33447 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751011AbcEGIri (ORCPT ); Sat, 7 May 2016 04:47:38 -0400 Date: Sat, 7 May 2016 10:45: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 2/7] futex: Hash private futexes per process In-Reply-To: <20160506215634.GH48432@f23x64.localdomain> Message-ID: References: <20160505204230.932454245@linutronix.de> <20160505204353.973009518@linutronix.de> <20160506180933.GE48432@f23x64.localdomain> <20160506215634.GH48432@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 Fri, 6 May 2016, Darren Hart wrote: > It would be good to have a way to detect that the process private hash table was > > successfully created. Perhaps a /proc/pid/ feature? This would allow us to write > > a functional futex test for tools/testing/selftests/futex > > I suppose we could just use FUTEX_PREALLOC_HASH for this purpose, passing in the > default hash size. This will either return the default, the previously set > value, or 0, indicating the global hash is being used. That should be sufficient > for programatically determining the state of the system. Right. > The /proc/pid/futex_hash_size option may still be convenient for other purposes. > Perhaps with a -1 indicating it hasn't been set yet. Dunno, whether that's valuable, but it can be done on top. Thanks, tglx