Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Mon, 4 Nov 2002 00:15:57 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Mon, 4 Nov 2002 00:15:57 -0500 Received: from air-2.osdl.org ([65.172.181.6]:47767 "EHLO mail.osdl.org") by vger.kernel.org with ESMTP id ; Mon, 4 Nov 2002 00:15:56 -0500 Date: Sun, 3 Nov 2002 21:18:01 -0800 (PST) From: "Randy.Dunlap" X-X-Sender: To: Davide Libenzi cc: William Lee Irwin III , Linux Kernel Mailing List , , Benjamin LaHaise Subject: Re: interrupt checks for spinlocks In-Reply-To: Message-ID: 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: 1992 Lines: 51 On Sun, 3 Nov 2002, Davide Libenzi wrote: | On Sun, 3 Nov 2002, William Lee Irwin III wrote: | | > On Sun, 3 Nov 2002, William Lee Irwin III wrote: | > [...] | > >> The only action taken is printk() and dump_stack(). No arch code has | > >> been futzed with to provide irq tainting yet. Looks like a good way | > >> to shake out lurking bugs to me (somewhat like may_sleep() etc.). | > | > On Sun, Nov 03, 2002 at 04:15:46PM -0800, Davide Libenzi wrote: | > > Wouldn't it be interesting to keep a ( per task ) list of acquired | > > spinlocks to be able to diagnose cross locks in case of stall ? | > > ( obviously under CONFIG_DEBUG_SPINLOCK ) | > | > That would appear to require cycle detection, but it sounds like a | > potential breakthrough usage of graph algorithms in the kernel. | > (I've always been told graph algorithms would come back to haunt me.) | > Or maybe not, deadlock detection has been done before. | > | > A separate patch/feature/whatever for deadlock detection could do that | > nicely, though. What I've presented here is meant only to flag far more | > trivial errors with interrupt enablement/disablement than the full | > deadlock detection problem. | | It's not realy a graph Bill. Each task has a list of acquired locks ( | by address ). You keep __LINE__ and __FILE__ with you list items. When | there's a deadlock you'll have somewhere : | | TSK#N TSK#M | ------------- | ... ... | LCK#I LCK#J | ... ... | -> LCK#J LCK#I | | Then with a SysReq key you dump the list of acquired locks for each task | who's spinning for a lock. IMO it might be usefull ... What's a task in this context? Are we (you) talking about kernel threads/drivers etc. or userspace? -- ~Randy "I'm a healthy mushroom." - 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/