lkml.org 
[lkml]   [2010]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [V3 PATCH] x86: avoid calling arch_trigger_all_cpu_backtrace() at the same time on SMP

Hm, another thing i noticed is that there's two of these:

> #ifdef ARCH_HAS_NMI_WATCHDOG
> +/* "in progress" flag of arch_trigger_all_cpu_backtrace */
> +static unsigned long backtrace_flag;
> +
> void arch_trigger_all_cpu_backtrace(void)
> {
> int i;
> + unsigned long flags;
> +
> + /*
> + * Have to disable irq here, as the
> + * arch_trigger_all_cpu_backtrace() could be
> + * triggered by "spin_lock()" with irqs on.
> + */
> + local_irq_save(flags);

> +/* "in progress" flag of arch_trigger_all_cpu_backtrace */
> +static unsigned long backtrace_flag;
> +
> void arch_trigger_all_cpu_backtrace(void)
> {
> int i;
> + unsigned long flags;
> +
> + /*
> + * Have to disable irq here, as the
> + * arch_trigger_all_cpu_backtrace() could be
> + * triggered by "spin_lock()" with irqs on.
> + */
> + local_irq_save(flags);
> +
> + if (test_and_set_bit(0, &backtrace_flag))

A fair amount of code is being duplicated in two places - which is not nice. Lets
try to create a shared facility instead?

Thanks,

Ingo


\
 
 \ /
  Last update: 2010-11-11 12:19    [W:0.067 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site