Messages in this thread | | | Date | Thu, 11 Nov 2010 10:23:01 +0100 | From | Ingo Molnar <> | Subject | Re: [PATCH] x86: avoid calling arch_trigger_all_cpu_backtrace() at the same time on SMP |
| |
* Dongdong Deng <dongdong.deng@windriver.com> wrote:
> +static int backtrace_flag;
> + if (cmpxchg(&backtrace_flag, 0, 1) != 0)
Sorry to be a PITA, but i asked for test_and_set() because that's the simplest primitive. cmpxchg() semantics is not nearly as obvious and people regularly get it wrong :-/
Also, variables that cmpxchg or test_and_set operates on need to be long, not int.
Ingo
| |