diff options
author | John Kacur <jkacur@redhat.com> | 2011-09-19 11:09:27 +0200 |
---|---|---|
committer | Clark Williams <williams@redhat.com> | 2011-12-28 16:25:45 -0600 |
commit | 38bf29b784018973f5e02474b48210cd15d8a68d (patch) | |
tree | e984bd38dcba6e87042b9cd3552ba092fbe1c327 /include | |
parent | cefc60b05f68182e2ecddaa953f17962c99df6a0 (diff) |
rwlocks: Fix section mismatch
This fixes the following build error for the preempt-rt kernel.
make kernel/fork.o
CC kernel/fork.o
kernel/fork.c:90: error: section of ¡tasklist_lock¢ conflicts with previous declaration
make[2]: *** [kernel/fork.o] Error 1
make[1]: *** [kernel/fork.o] Error 2
The rt kernel cache aligns the RWLOCK in DEFINE_RWLOCK by default.
The non-rt kernels explicitly cache align only the tasklist_lock in
kernel/fork.c
That can create a build conflict. This fixes the build problem by making the
non-rt kernels cache align RWLOCKs by default. The side effect is that
the other RWLOCKs are also cache aligned for non-rt.
This is a short term solution for rt only.
The longer term solution would be to push the cache aligned DEFINE_RWLOCK
to mainline. If there are objections, then we could create a
DEFINE_RWLOCK_CACHE_ALIGNED or something of that nature.
Comments? Objections?
Signed-off-by: John Kacur <jkacur@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/alpine.LFD.2.00.1109191104010.23118@localhost6.localdomain6
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/rwlock_types.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/rwlock_types.h b/include/linux/rwlock_types.h index 5317cd957292..d0da966ad7a0 100644 --- a/include/linux/rwlock_types.h +++ b/include/linux/rwlock_types.h @@ -47,6 +47,7 @@ typedef struct { RW_DEP_MAP_INIT(lockname) } #endif -#define DEFINE_RWLOCK(x) rwlock_t x = __RW_LOCK_UNLOCKED(x) +#define DEFINE_RWLOCK(name) \ + rwlock_t name __cacheline_aligned_in_smp = __RW_LOCK_UNLOCKED(name) #endif /* __LINUX_RWLOCK_TYPES_H */ |