Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754930AbXHJFhB (ORCPT ); Fri, 10 Aug 2007 01:37:01 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751470AbXHJFgx (ORCPT ); Fri, 10 Aug 2007 01:36:53 -0400 Received: from mail1.sea5.speakeasy.net ([69.17.117.3]:49641 "EHLO mail1.sea5.speakeasy.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751130AbXHJFgw (ORCPT ); Fri, 10 Aug 2007 01:36:52 -0400 Message-ID: <46BBF965.5030203@freedesktop.org> Date: Thu, 09 Aug 2007 22:36:37 -0700 From: Josh Triplett User-Agent: Mozilla-Thunderbird 2.0.0.4 (X11/20070622) MIME-Version: 1.0 To: Andrew Morton CC: Mariusz Kozlowski , linux-kernel@vger.kernel.org, Ingo Molnar , "Randy.Dunlap" Subject: Re: 2.6.23-rc2-mm1: sleeping function called from invalid context at kernel/mutex.c:86 References: <20070809015106.cd0bfc53.akpm@linux-foundation.org> <200708100123.07762.m.kozlowski@tuxland.pl> <20070809171128.03f40dff.akpm@linux-foundation.org> In-Reply-To: <20070809171128.03f40dff.akpm@linux-foundation.org> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3429 Lines: 89 Andrew Morton wrote: > On Fri, 10 Aug 2007 01:23:07 +0200 > Mariusz Kozlowski wrote: > >> Hello, >> >> This probably doesn't have great impact ;) but ... >> To reproduce: run torture tests for RCU and then sysrq+q. >> >> SysRq : Show Pending Timers >> Timer List Version: v0.3 >> HRTIMER_MAX_CLOCK_BASES: 2 >> now at 1764338760370 nsecs >> >> cpu: 0 >> clock 0: >> .index: 0 >> .resolution: 1 nsecs >> .get_time: ktime_get_real >> .offset: 1186699025823815427 nsecs >> active timers: >> clock 1: >> .index: 1 >> .resolution: 1 nsecs >> .get_time: ktime_get >> .offset: 0 nsecs >> active timers: >> #0: <3>BUG: sleeping function called from invalid context at kernel/mutex.c:86 >> in_atomic():1, irqs_disabled():1 >> INFO: lockdep is turned off. >> irq event stamp: 0 >> hardirqs last enabled at (0): [<00000000>] 0x0 >> hardirqs last disabled at (0): [] copy_process+0x4a8/0x144c >> softirqs last enabled at (0): [] copy_process+0x4c6/0x144c >> softirqs last disabled at (0): [<00000000>] 0x0 >> [] show_trace_log_lvl+0x1a/0x30 >> [] show_trace+0x12/0x14 >> [] dump_stack+0x15/0x17 >> [] __might_sleep+0xb7/0xc9 >> [] mutex_lock+0x15/0x1f >> [] lookup_module_symbol_name+0x17/0xc0 >> [] lookup_symbol_name+0x3f/0x43 >> [] print_name_offset+0x1f/0x96 >> [] timer_list_show+0x802/0xcbd >> [] sysrq_timer_list_show+0xc/0xe >> [] sysrq_handle_show_timers+0x8/0xa >> [] __handle_sysrq+0x7b/0x115 >> [] handle_sysrq+0x20/0x24 >> [] kbd_event+0x3a8/0x5c7 >> [] input_pass_event+0x8f/0x91 >> [] input_handle_event+0x98/0x38d >> [] input_event+0x54/0x67 >> [] atkbd_interrupt+0x200/0x59e >> [] serio_interrupt+0x7c/0x80 >> [] i8042_interrupt+0x17a/0x289 >> [] handle_IRQ_event+0x28/0x59 >> [] handle_level_irq+0xad/0x10b >> [] do_IRQ+0x93/0xd0 >> [] common_interrupt+0x2e/0x34 >> [] rcu_read_delay+0x8/0x36 [rcutorture] >> [] rcu_torture_reader+0x6e/0x169 [rcutorture] >> [] kthread+0x36/0x58 >> [] kernel_thread_helper+0x7/0x1c >> ======================= > > We seem to have made a mess in there. timer_list_show() ends up calling > lookup_module_symbol_name(), which takes a mutex. However print_symbol() > (which is called at oops time, interrupt time, etc) calls > module_address_lookup(), which is basically the same, only it doesn't take > the mutex. > > I guess a quicky fix would be to switch > kernel/time/timer_list.c:print_name_offset() from > lookup_module_symbol_name() to module_address_lookup(). But we'd still > have a mess in there. > > (adds ccs, runs away) I don't think rcutorture matters for this bug. As far as I can tell, Andrew's description of this problem will always apply to this particular sysrq: the keyboard interrupt leads to handle_sysrq, which leads to timer_list_show, which leads to lookup_module_symbol_name, which acquires a mutex. - Josh Triplett - 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/