From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760616AbYDZSaE (ORCPT ); Sat, 26 Apr 2008 14:30:04 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755034AbYDZS3y (ORCPT ); Sat, 26 Apr 2008 14:29:54 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:38794 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756585AbYDZS3x (ORCPT ); Sat, 26 Apr 2008 14:29:53 -0400 Date: Sat, 26 Apr 2008 11:29:07 -0700 From: Andrew Morton To: "Justin Mattock" Cc: "Linux Kernel Mailing List" , Venkatesh Pallipadi , Ingo Molnar Subject: Re: spinlock lockup on CPU#0 Message-Id: <20080426112907.77613dee.akpm@linux-foundation.org> In-Reply-To: References: X-Mailer: Sylpheed 2.4.8 (GTK+ 2.12.5; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 24 Apr 2008 01:41:32 +0000 "Justin Mattock" wrote: > Hello, I recorded a .mov of a spinlock, but cant seem to send it out, > so I have to manually write it down: > > BUG: spinlock lockup on CPU#0, swapper/0, c17fa6c0 > Pid: 0. swapper Not tainted 2.6.25-03562-g3dc5063 #1 > [] _raw_spin_lock+0xd5/0xf9 > [] _spin_lock+0x8/0xa > [] task_rq_lock+0x44/0x6b > [] try_to_wake+0x2a/0x1c4 > [] default_wake_function+0xb/0xd > [] __wake_up_common+0x2f/0x5a > [] complete+0x2b/0x3e > [] usb_api_blocking_completion+0x13/0x15 > [] usb_hcd_giveback_urb+0x52/0x82 > [] ehci_urb_done+0x6f/0x7c [ehci_hcd] > [] qh_completions+0x2d7/0x348 [ehci_hcd] > [] ehci_work+0x9c [ehci_hcd] > [] ? sched_clock+0xb/0x1c > [] ? __update_rq_clock+0x94/0x15a > [] ehci_irq+0x138/0x15f [ehci_hcd] > [ ] usb_hcd_irq+0x23/0x51 > [] handle_IRQ_event+0x2a/0x5a > [] handle_fasteoi_irq+0x74/0xb6 > [] do_IRQ+0x71/0x8c > [] common_interrupt+0x23/0x28 > [] ? sched_clock_idle_wakeup_event+0x5b/0x74 > [] acpi_idle_enter_bm+0x2a4/0x31f [processor] > [] cpuidle_idle_call+0x5c/0x8c > [] ? cpuidle_idle_call+0x0/0x8c > [] cpu_idle+0xb1/0xd1 > [] reset_init+0x49/0x4b > ===================================================== > > > Hopefully the numbers are right, and hopefully this provides enough > info to help the kernel out Well that's cute. At a guess I'd say that acpi_processor_idle() managed to call sched_clock_idle_wakeup_event() with local interrupts enabled. We took an interrupt with rq->lock held and things went downhill from there. Can you add this please, see if it triggers? --- a/kernel/sched.c~a +++ a/kernel/sched.c @@ -811,6 +811,7 @@ void sched_clock_idle_sleep_event(void) { struct rq *rq = cpu_rq(smp_processor_id()); + WARN_ON(!irqs_disabled()); spin_lock(&rq->lock); __update_rq_clock(rq); spin_unlock(&rq->lock); @@ -826,6 +827,7 @@ void sched_clock_idle_wakeup_event(u64 d struct rq *rq = cpu_rq(smp_processor_id()); u64 now = sched_clock(); + WARN_ON(!irqs_disabled()); rq->idle_clock += delta_ns; /* * Override the previous timestamp and ignore all _