Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Tue, 17 Sep 2002 10:08:58 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Tue, 17 Sep 2002 10:08:58 -0400 Received: from mailrelay1.lanl.gov ([128.165.4.101]:32657 "EHLO mailrelay1.lanl.gov") by vger.kernel.org with ESMTP id ; Tue, 17 Sep 2002 10:08:57 -0400 Subject: Re: [PATCH] BUG(): sched.c: Line 944 From: Steven Cole To: Robert Love Cc: Linus Torvalds , Linux Kernel In-Reply-To: <1032253191.4592.15.camel@phantasy> References: <1032250378.969.112.camel@phantasy> <1032253191.4592.15.camel@phantasy> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Evolution/1.0.2-5mdk Date: 17 Sep 2002 08:10:20 -0600 Message-Id: <1032271821.11913.10.camel@spc9.esa.lanl.gov> Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2385 Lines: 66 On Tue, 2002-09-17 at 02:59, Robert Love wrote: > On Tue, 2002-09-17 at 04:12, Robert Love wrote: > > > I implemented exactly what you detailed, with one change: we need to > > check kernel_locked() before setting lock_depth because it is valid to > > exit() while holding the BKL. Aside from kernel code that does it > > intentionally, crashed code (e.g. modules) would have the same problem. > > fsck, this is non-ending... obviously, this is insufficient: > preempt_count will equal two if the BKL was previously held and > in_atomic() will trip. > > This should work: > > if (likely(!kernel_locked()) > tsk->lock_depth = -2; > else { > /* compensate for BKL; we still cannot preempt */ > preempt_enable_no_resched(); > } > Robert, I applied the modified patch you sent at 04:51 plus the above and had to change dump_stack() to show_stack(NULL) in sched.c due to kernel/kernel.o: In function `schedule': kernel/kernel.o(.text+0xf13): undefined reference to `dump_stack' I used plain vanilla 2.5.35 to patch against. I booted that so-patched kernel and it got much further than before, up to where syslogd was able to write some stuff to /var/log/messages. There were many instances of "error: scheduling while non-atomic!", and the traces were similar. Here is a decoded one: [steven@spc5 linux-2.5.35]$ ksymoops -K -L -O -v vmlinux -m System.map ] [] [] [] [] Warning (Oops_read): Code line not seen, dumping what data is available Trace; c011c51b Trace; c011d08b Trace; c012d67f Trace; c012d6c5 Trace; c010918f Hope this helps, Steven - 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/