Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261155AbUKEVm6 (ORCPT ); Fri, 5 Nov 2004 16:42:58 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261170AbUKEVm6 (ORCPT ); Fri, 5 Nov 2004 16:42:58 -0500 Received: from host-65-117-135-105.timesys.com ([65.117.135.105]:23763 "EHLO yoda.timesys") by vger.kernel.org with ESMTP id S261155AbUKEVm4 (ORCPT ); Fri, 5 Nov 2004 16:42:56 -0500 Date: Fri, 5 Nov 2004 16:42:38 -0500 To: Ingo Molnar Cc: john cooper , Mark_H_Johnson@raytheon.com, Karsten Wiese , Bill Huey , Adam Heath , "K.R. Foley" , linux-kernel@vger.kernel.org, Florian Schmidt , Fernando Pablo Lopez-Lezcano , Lee Revell , Rui Nuno Capela , Thomas Gleixner , Michal Schmidt Subject: Re: [patch] Real-Time Preemption, -RT-2.6.10-rc1-mm2-V0.7.1 Message-ID: <20041105214238.GA11075@yoda.timesys> References: <20041104163012.GA3498@elte.hu> <20041104163254.GA3810@elte.hu> <418A7BFB.6020501@timesys.com> <20041104194416.GC10107@elte.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041104194416.GC10107@elte.hu> User-Agent: Mutt/1.5.4i From: Scott Wood Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1508 Lines: 31 On Thu, Nov 04, 2004 at 08:44:16PM +0100, Ingo Molnar wrote: > > * john cooper wrote: > > > > This is a fairly gnarly problem to address. The obvious solution is > > to hold spinlocks in the mutexes as the dependency tree is atomically > > traversed. However this will deadlock under MP due to the > > unpredictable order of mutexes traversed. If the dependency chain is > > not traversed (and semantics applied) atomically, races exist which > > cause promotion decisions to be made on [now] stale data. > > is the order of locks in the dependency chain really unpredictable? If > two chain walkers get two locks in opposite order, doesnt that mean that > the lock ordering (as attempted by the blocked tasks) is deadlock-prone > already? I.e. this scenario should not happen. It *shouldn't*, but bugs do happen, and it'd be nice if a mutex deadlock didn't get promoted into a less debuggable spinlock deadlock. Plus, if there's any intention of ever exporting this priority inheritance mechanism to userspace locks, we don't want to promote a userspace deadlock into a kernel one. Given how rarely contention should occur, I don't think that a single lock would be a bottleneck except for obscenely large SMP machines. -Scott - 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/