Messages in this thread | | | Date | Mon, 13 Sep 2004 23:52:25 -0700 | From | Andrew Morton <> | Subject | Re: [profile] amortize atomic hit count increments |
| |
William Lee Irwin III <wli@holomorphy.com> wrote: >
A few comments which describe the design would be nice...
> +#ifdef CONFIG_SMP > +static void __profile_flip_buffers(void *unused) > +{ > + int cpu = get_cpu(); > + unsigned long flags; > + > + local_irq_save(flags); > + per_cpu(cpu_profile_flip, cpu) = !per_cpu(cpu_profile_flip, cpu); > + local_irq_restore(flags); > + put_cpu(); > +}
hm. Does an IPI handler need to disable local IRQs?
> +static void profile_flip_buffers(void) > +{ > + static DECLARE_MUTEX(profile_flip_mutex); > + int i, j, cpu; > + > + down(&profile_flip_mutex); > + j = per_cpu(cpu_profile_flip, smp_processor_id());
Is this preempt-safe?
> + on_each_cpu(__profile_flip_buffers, NULL, 0, 1); > + for_each_online_cpu(cpu) { > + struct profile_hit *hits = per_cpu(cpu_profile_hits, cpu)[j];
- 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/
| |