Re: [PATCH] mutex: Introduce arch_mutex_cpu_relax()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Gerald Schaefer
Date: Tuesday, November 23, 2010 - 7:12 am

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:

#ifdef CONFIG_DEBUG_MUTEXES
# include "mutex-debug.h"
# include <asm-generic/mutex-null.h>
#else
# include "mutex.h"
# include <asm/mutex.h>
#endif

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
at all)?


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] mutex: Introduce arch_mutex_cpu_relax(), Gerald Schaefer, (Mon Nov 22, 7:47 am)
Re: [PATCH] mutex: Introduce arch_mutex_cpu_relax(), Andrew Morton, (Mon Nov 22, 1:10 pm)
Re: [PATCH] mutex: Introduce arch_mutex_cpu_relax(), Gerald Schaefer, (Tue Nov 23, 7:12 am)
Re: [PATCH] mutex: Introduce arch_mutex_cpu_relax(), Peter Zijlstra, (Tue Nov 23, 7:20 am)
Re: [PATCH] mutex: Introduce arch_mutex_cpu_relax(), Gerald Schaefer, (Tue Nov 23, 8:03 am)
[tip:sched/core] mutexes, sched: Introduce arch_mutex_cpu_ ..., tip-bot for Gerald S ..., (Fri Nov 26, 8:02 am)