Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261304AbVBVWLK (ORCPT ); Tue, 22 Feb 2005 17:11:10 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261302AbVBVWLK (ORCPT ); Tue, 22 Feb 2005 17:11:10 -0500 Received: from fire.osdl.org ([65.172.181.4]:4041 "EHLO smtp.osdl.org") by vger.kernel.org with ESMTP id S261298AbVBVWKi (ORCPT ); Tue, 22 Feb 2005 17:10:38 -0500 Date: Tue, 22 Feb 2005 14:10:58 -0800 (PST) From: Linus Torvalds To: Benjamin Herrenschmidt cc: Olof Johansson , Kernel Mailing List , Andrew Morton , jamie@shareable.org, Rusty Russell , David Howells Subject: Re: [PATCH/RFC] Futex mmap_sem deadlock In-Reply-To: <1109108532.5411.149.camel@gaston> Message-ID: References: <20050222190646.GA7079@austin.ibm.com> <1109106969.5412.138.camel@gaston> <1109108532.5411.149.camel@gaston> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1423 Lines: 33 On Wed, 23 Feb 2005, Benjamin Herrenschmidt wrote: > > 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. Yes, the starvation issue is potentially real. And thinking about it, we've even had that in real life, with /proc and lots of page faults. So I guess that's a strong argument for the fairness thing. Oh, well. The reason I hate the rwsem behaviour is exactly because it results in this very subtle class of deadlocks. This one case is certainly solvable several ways, but do we have other issues somewhere else? Things like kobject might be ripe with things like this. The mm semaphore tends to be pretty well-behaved - and I'm not sure the same is true of the kobject one. Normal recursive deadlocks are wonderful - most of them show up immediately, so assuming you just have enough coverage, you're fine. This fairness-related deadlock requires a race to happen. Maybe it would be sufficient to have a debugging version of rwsems that just notice recursion? Linus - 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/