diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-07-03 03:24:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-03 18:27:05 -0400 |
commit | 6205120044bb75ca06019491d1aa0e727fdd35be (patch) | |
tree | 6e770ddc5a4ac3ff44977fde863046921394863a /net/ipv4/route.c | |
parent | a0f1ccfd8d37457a6d8a9e01acebeefcdfcc306e (diff) |
[PATCH] lockdep: fix RT_HASH_LOCK_SZ
On lockdep we have a quite big spinlock_t, so keep the size down.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r-- | net/ipv4/route.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 283a72247e5e..2dc6dbb28467 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -210,17 +210,22 @@ struct rt_hash_bucket { | |||
210 | /* | 210 | /* |
211 | * Instead of using one spinlock for each rt_hash_bucket, we use a table of spinlocks | 211 | * Instead of using one spinlock for each rt_hash_bucket, we use a table of spinlocks |
212 | * The size of this table is a power of two and depends on the number of CPUS. | 212 | * The size of this table is a power of two and depends on the number of CPUS. |
213 | * (on lockdep we have a quite big spinlock_t, so keep the size down there) | ||
213 | */ | 214 | */ |
214 | #if NR_CPUS >= 32 | 215 | #ifdef CONFIG_LOCKDEP |
215 | #define RT_HASH_LOCK_SZ 4096 | 216 | # define RT_HASH_LOCK_SZ 256 |
216 | #elif NR_CPUS >= 16 | ||
217 | #define RT_HASH_LOCK_SZ 2048 | ||
218 | #elif NR_CPUS >= 8 | ||
219 | #define RT_HASH_LOCK_SZ 1024 | ||
220 | #elif NR_CPUS >= 4 | ||
221 | #define RT_HASH_LOCK_SZ 512 | ||
222 | #else | 217 | #else |
223 | #define RT_HASH_LOCK_SZ 256 | 218 | # if NR_CPUS >= 32 |
219 | # define RT_HASH_LOCK_SZ 4096 | ||
220 | # elif NR_CPUS >= 16 | ||
221 | # define RT_HASH_LOCK_SZ 2048 | ||
222 | # elif NR_CPUS >= 8 | ||
223 | # define RT_HASH_LOCK_SZ 1024 | ||
224 | # elif NR_CPUS >= 4 | ||
225 | # define RT_HASH_LOCK_SZ 512 | ||
226 | # else | ||
227 | # define RT_HASH_LOCK_SZ 256 | ||
228 | # endif | ||
224 | #endif | 229 | #endif |
225 | 230 | ||
226 | static spinlock_t *rt_hash_locks; | 231 | static spinlock_t *rt_hash_locks; |