From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932436AbcESTiY (ORCPT ); Thu, 19 May 2016 15:38:24 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:46350 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754255AbcESTiX (ORCPT ); Thu, 19 May 2016 15:38:23 -0400 Date: Thu, 19 May 2016 12:38:19 -0700 From: Darren Hart To: Peter Zijlstra Cc: Thomas Gleixner , LKML , Sebastian Andrzej Siewior , Linus Torvalds , Darren Hart , 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 Message-ID: <20160519193819.GB1872@f23x64.localdomain> References: <20160505204230.932454245@linutronix.de> <20160505204354.051976225@linutronix.de> <20160519122457.GB3192@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160519122457.GB3192@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 19, 2016 at 02:24:57PM +0200, Peter Zijlstra wrote: > On Thu, May 05, 2016 at 08:44:05PM -0000, Thomas Gleixner wrote: > > From: Sebastian Siewior > > > > The per process hash is allocated on the fly at the first futex operation of a > > process. The size of the hash is determined by a system wide default setting > > controlled by the sys admin, This is suboptimal for RT applications and > > applications with pathological futex abuse, > > > > - For RT applications its important to allocate the per process hash before the > > first futex operation to avoid the allocation on the first futex operation. > > > > - For pathological applications which use gazillions of futexes its useful to > > allocate a hash greater than the default hash size. > > > > Add a futex op which allows to preallocate the hash with the requested > > size. The size is limited by the systemwide maximum hash size, which can be > > set by the admin. The requested size is rounded up to the next order of 2. > > > > The function can be called several times, but ony the first call results in a > > hash allocation of the requested size as there is no non-intrusive way to > > reallocate/rehash in a multithreaded application. > > > > Note, that this call must be issued before the first futex operation in the > > process because that would automatically allocate the default sized hash. > > > > The function returns the actual hash size or 0 if the global hash is used. The > > latter is the case on UP and in the rare case that the allocation failed and > > the global hash is used as a fallback. > > OK, so no on-line rehashing possible? It doesn't do it currently... did you see something that makes it impossible to add? -- Darren Hart Intel Open Source Technology Center