lkml.org 
[lkml]   [2004]   [Nov]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH][OPROFILE] disable preempt when calling smp_processor_id()
On Fri, Nov 05, 2004 at 04:32:21PM -0800, Chris Wright wrote:

> smp_processor_id() is called w/out preempt disabled. Use
> get_cpu()/put_cpu() instead. Should this be put_cpu_no_resched()?

No, the patch below looks fine

regards
john

> Signed-off-by: Chris Wright <chrisw@osdl.org>
>
> --- 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/

\
 
 \ /
  Last update: 2005-03-22 14:07    [W:0.084 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site