lkml.org 
[lkml]   [2004]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [profile] fix timer interrupt livelock on 512x Altix
From
Date
On Tue, 2004-09-21 at 07:30, William Lee Irwin III wrote:
> +static void __profile_flip_buffers(void *unused)
> +{
> + int cpu = smp_processor_id();
> +
> + per_cpu(cpu_profile_flip, cpu) = !per_cpu(cpu_profile_flip, cpu);
> +}

Please: one point of per-cpu vars is that archs can choose to hold the
per-cpu offset in a reg, and derive smp_processor_id() from that. By
doing the reverse, manually, you defeat this. How about:

int *flip = __get_cpu_var(cpu_profile_flip);
*flip = !*flip;

> +
> +static void profile_flip_buffers(void)
> +{
> + int i, j, cpu;
> +
> + down(&profile_flip_mutex);
> + j = per_cpu(cpu_profile_flip, get_cpu());
> + put_cpu();

Similarly, this is equivalent to:
j = __get_cpu_var(cpu_profile_flip);

Cheers,
Rusty.
--
Anyone who quotes me in their signature is an idiot -- Rusty Russell

-
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.046 / U:13.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site