lkml.org 
[lkml]   [2004]   [Sep]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [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/

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