
From: Ingo Molnar <mingo@elte.hu>

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/include/linux/smp.h |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)

diff -puN include/linux/smp.h~smp_processor_id-commentary include/linux/smp.h
--- 25/include/linux/smp.h~smp_processor_id-commentary	2004-11-18 01:43:47.674138808 -0800
+++ 25-akpm/include/linux/smp.h	2004-11-18 01:43:47.677138352 -0800
@@ -109,12 +109,24 @@ static inline void smp_send_reschedule(i
 
 #endif /* !SMP */
 
+/*
+ * DEBUG_PREEMPT support: check whether smp_processor_id() is being
+ * used in a preemption-safe way.
+ *
+ * An architecture has to enable this debugging code explicitly.
+ * It can do so by renaming the smp_processor_id() macro to
+ * __smp_processor_id().  This should only be done after some minimal
+ * testing, because usually there are a number of false positives
+ * that an architecture will trigger.
+ *
+ * To fix a false positive (i.e. smp_processor_id() use that the
+ * debugging code reports but which use for some reason is legal),
+ * change the smp_processor_id() reference to _smp_processor_id(),
+ * which is the nondebug variant.  NOTE: don't use this to hack around
+ * real bugs.
+ */
 #ifdef __smp_processor_id
 # if defined(CONFIG_PREEMPT) && defined(CONFIG_DEBUG_PREEMPT)
-  /*
-   * temporary debugging check detecting places that use
-   * smp_processor_id() in a potentially unsafe way:
-   */
    extern unsigned int smp_processor_id(void);
 # else
 #  define smp_processor_id() __smp_processor_id()
_
