From: Ingo Molnar On lockdep we have a quite big spinlock_t, so keep the size down. Signed-off-by: Ingo Molnar Signed-off-by: Arjan van de Ven Signed-off-by: Andrew Morton --- net/ipv4/route.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff -puN net/ipv4/route.c~lock-validator-fix-rt_hash_lock_sz net/ipv4/route.c --- devel/net/ipv4/route.c~lock-validator-fix-rt_hash_lock_sz 2006-05-30 17:58:25.000000000 -0700 +++ devel-akpm/net/ipv4/route.c 2006-05-30 17:58:25.000000000 -0700 @@ -212,17 +212,22 @@ struct rt_hash_bucket { /* * Instead of using one spinlock for each rt_hash_bucket, we use a table of spinlocks * The size of this table is a power of two and depends on the number of CPUS. + * (on lockdep we have a quite big spinlock_t, so keep the size down there) */ -#if NR_CPUS >= 32 -#define RT_HASH_LOCK_SZ 4096 -#elif NR_CPUS >= 16 -#define RT_HASH_LOCK_SZ 2048 -#elif NR_CPUS >= 8 -#define RT_HASH_LOCK_SZ 1024 -#elif NR_CPUS >= 4 -#define RT_HASH_LOCK_SZ 512 +#ifdef CONFIG_LOCKDEP +# define RT_HASH_LOCK_SZ 256 #else -#define RT_HASH_LOCK_SZ 256 +# if NR_CPUS >= 32 +# define RT_HASH_LOCK_SZ 4096 +# elif NR_CPUS >= 16 +# define RT_HASH_LOCK_SZ 2048 +# elif NR_CPUS >= 8 +# define RT_HASH_LOCK_SZ 1024 +# elif NR_CPUS >= 4 +# define RT_HASH_LOCK_SZ 512 +# else +# define RT_HASH_LOCK_SZ 256 +# endif #endif static spinlock_t *rt_hash_locks; _