Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754037AbXECUKU (ORCPT ); Thu, 3 May 2007 16:10:20 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754052AbXECUKU (ORCPT ); Thu, 3 May 2007 16:10:20 -0400 Received: from gateway-1237.mvista.com ([63.81.120.158]:37632 "EHLO localhost.localdomain" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754037AbXECUKT (ORCPT ); Thu, 3 May 2007 16:10:19 -0400 Message-Id: <20070503200822.696754319@mvista.com> User-Agent: quilt/0.46-1 Date: Thu, 03 May 2007 13:08:22 -0700 From: Daniel Walker To: mingo@elte.hu Cc: srostedt@redhat.com, linux-kernel@vger.kernel.org Subject: [PATCH -rt] wrong usage of smp_processor_id() Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1792 Lines: 49 Found this while debugging with Steve .. trace_hardirqs_on() isn't always called with interrupt off. BUG: using smp_processor_id() in preemptible [00000000] code: init/1 caller is trace_hardirqs_on+0x16/0xe0 [] show_trace_log_lvl+0x21/0x50 [] show_trace+0x12/0x20 [] dump_stack+0x16/0x20 [] debug_smp_processor_id+0xa9/0xb0 [] trace_hardirqs_on+0x16/0xe0 [] do_notify_resume+0x115/0x7b0 [] work_notifysig+0x13/0x1b ======================= --------------------------- | preempt count: 00000001 ] | 1-level deep critical section nesting: ---------------------------------------- .. [] .... debug_smp_processor_id+0x53/0xb0 .....[] .. ( <= trace_hardirqs_on+0x16/0xe0) Signed-Off-By: Daniel Walker --- kernel/latency_trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6.21/kernel/latency_trace.c =================================================================== --- linux-2.6.21.orig/kernel/latency_trace.c +++ linux-2.6.21/kernel/latency_trace.c @@ -105,7 +105,7 @@ static inline int DEBUG_WARN_ON(int cond #ifdef CONFIG_CRITICAL_IRQSOFF_TIMING # ifdef CONFIG_CRITICAL_PREEMPT_TIMING static DEFINE_PER_CPU(int, trace_cpu_idle); -# define irqs_off_preempt_count() (!__get_cpu_var(trace_cpu_idle) && preempt_count()) +# define irqs_off_preempt_count() (preempt_count() && !__get_cpu_var(trace_cpu_idle)) # else # define irqs_off_preempt_count() 0 # endif -- -- - 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/