On Mo, 2010-11-22 at 12:10 -0800, Andrew Morton wrote:
Well, I've tried that with my last approach, defining arch_mutex_cpu_relax()
in <asm/mutex.h> and including that from <linux/mutex.h>. This didn't work
well because of ugly header file dependencies, and Peter also commented
that "including "asm/mutex.h" isn't advised". The problem is the following
code in kernel/mutex.c (after including <linux/mutex.h>) when
CONFIG_DEBUG_MUTEXES is set:
# include "mutex-debug.h"
# include <asm-generic/mutex-null.h>
# include "mutex.h"
# include <asm/mutex.h>
So I can only include <asm/mutex.h> from <linux/mutex.h> with an ugly
"#ifndef CONFIG_DEBUG_MUTEXES" around it, or use a completely different
or new arch header file (but <asm/mutex.h> seems like the right place
for this). The CONFIG_ approach avoids all this header file dependency
mess, or did I miss something (or maybe it's just me and it is not ugly