Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261286AbUKFAca (ORCPT ); Fri, 5 Nov 2004 19:32:30 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261289AbUKFAca (ORCPT ); Fri, 5 Nov 2004 19:32:30 -0500 Received: from fw.osdl.org ([65.172.181.6]:28649 "EHLO mail.osdl.org") by vger.kernel.org with ESMTP id S261286AbUKFAc0 (ORCPT ); Fri, 5 Nov 2004 19:32:26 -0500 Date: Fri, 5 Nov 2004 16:32:21 -0800 From: Chris Wright To: levon@movementarian.org Cc: akpm@osdl.org, linux-kernel@vger.kernel.org, cliffw@osdl.org Subject: [PATCH][OPROFILE] disable preempt when calling smp_processor_id() Message-ID: <20041105163221.J14339@build.pdx.osdl.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1645 Lines: 45 Oprofile is hitting many of the below BUG messages. BUG: using smp_processor_id() in preemptible [00000001] code: sleep/4892 caller is task_exit_notify+0x9/0x17 Call Trace: {smp_processor_id+191} {task_exit_notify+9} {notifier_call_chain+32} {profile_task_exit+49} {do_exit+34} {process_timeout+0} {do_group_exit+264} {system_call+126} smp_processor_id() is called w/out preempt disabled. Use get_cpu()/put_cpu() instead. Should this be put_cpu_no_resched()? Signed-off-by: Chris Wright --- linux-2.6.10-rc1-mm3-smp_processor_id/drivers/oprofile/buffer_sync.c~orig 2004-11-05 15:21:21.551984200 -0800 +++ linux-2.6.10-rc1-mm3-smp_processor_id/drivers/oprofile/buffer_sync.c 2004-11-05 15:23:29.000000000 -0800 @@ -62,7 +62,8 @@ /* To avoid latency problems, we only process the current CPU, * hoping that most samples for the task are on this CPU */ - sync_buffer(smp_processor_id()); + sync_buffer(get_cpu()); + put_cpu(); return 0; } @@ -86,7 +87,8 @@ /* To avoid latency problems, we only process the current CPU, * hoping that most samples for the task are on this CPU */ - sync_buffer(smp_processor_id()); + sync_buffer(get_cpu()); + put_cpu(); return 0; } - 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/