Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261282AbVBVVnz (ORCPT ); Tue, 22 Feb 2005 16:43:55 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261284AbVBVVny (ORCPT ); Tue, 22 Feb 2005 16:43:54 -0500 Received: from gate.crashing.org ([63.228.1.57]:35551 "EHLO gate.crashing.org") by vger.kernel.org with ESMTP id S261282AbVBVVnM (ORCPT ); Tue, 22 Feb 2005 16:43:12 -0500 Subject: Re: [PATCH/RFC] Futex mmap_sem deadlock From: Benjamin Herrenschmidt To: Linus Torvalds Cc: Olof Johansson , Kernel Mailing List , Andrew Morton , jamie@shareable.org, Rusty Russell , David Howells In-Reply-To: References: <20050222190646.GA7079@austin.ibm.com> <1109106969.5412.138.camel@gaston> Content-Type: text/plain Date: Wed, 23 Feb 2005 08:42:12 +1100 Message-Id: <1109108532.5411.149.camel@gaston> Mime-Version: 1.0 X-Mailer: Evolution 2.0.3 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 947 Lines: 25 On Tue, 2005-02-22 at 13:31 -0800, Linus Torvalds wrote: > > On Wed, 23 Feb 2005, Benjamin Herrenschmidt wrote: > > > > Isn't Olof scheme racy ? Can't the stuff get swapped out between the > > first get_user() and the "real" one ? > > Yes. But see my suggested modification (which I still think is "the thing > that Olof does", except it's more efficient and avoids the race). > > If rwsems acted like rwlocks, we wouldn't have this issue at all. Yours is probably the most efficient too. Note sure what is best for rwsems tho, there seem to be some interest preventing readers from starving writers for ever, this has been debated endlessly iirc, though I have no personal opinion there. Ben. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/