From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757641AbcEEUr2 (ORCPT ); Thu, 5 May 2016 16:47:28 -0400 Received: from www.linutronix.de ([62.245.132.108]:56746 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755750AbcEEUpr (ORCPT ); Thu, 5 May 2016 16:45:47 -0400 Message-Id: <20160505204354.383905070@linutronix.de> User-Agent: quilt/0.63-1 Date: Thu, 05 May 2016 20:44:08 -0000 From: Thomas Gleixner To: LKML Cc: 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: [patch V2 7/7] futex.2: Document hash preallocation opcode References: <20160505204230.932454245@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Disposition: inline; filename=futex.2--Document-hash-preallocation-opcode 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,URIBL_BLOCKED=0.001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org At least an attempt to document the futex attached mode extension. Signed-off-by: Thomas Gleixner --- man2/futex.2 | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) --- a/man2/futex.2 +++ b/man2/futex.2 @@ -767,6 +767,40 @@ operations correspond to and .BR FUTEX_WAKE_BITSET operations where the bit masks are all ones. + +.\" +.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +.\" +.TP +.BR FUTEX_PREALLOC_HASH " (since Linux ?.?.?)" +This operation preallocates the per process private hash with a hash size +provided by the +.IR val +argument. + +This operation tells the kernel to preallocate the per process private hash +with a given hash size. The size is rounded up to the next power of two and +limited internally in the kernel according to the sys control setting. + +The per process private hash is allocated once and cannot be resized. The +allocation either happens by this op code or automatically when the first real +futex operation takes place. + +If the hash is allocated then subsequent calls with this opcode return the +currently active hash size. + +If the returned size value is 0 then the global hash is used instead of the +process private hash. This can happen on UP machines where the private hashing +is disabled and in case of memory allocation failure. + +The +.IR uaddr , +.IR timeout , +.IR uaddr2 +and +.I val3 +arguments are ignored. + .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" @@ -1334,6 +1368,12 @@ the futex word at Returns 0 if the caller was successfully requeued to the futex for the futex word at .IR uaddr2 . +.TP +.B FUTEX_PREALLOC_HASH +Returns the size of the allocated hash, i.e. the number of hash slots. If the +size value is 0 then the global hash is used instead of the process private +hash. This can happen on UP machines where the private hashing is disabled and +in case of memory allocation failure. .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\"