diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rhashtable.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/rhashtable.c b/lib/rhashtable.c index 5d845ffd7982..42acd81f10db 100644 --- a/lib/rhashtable.c +++ b/lib/rhashtable.c | |||
@@ -30,7 +30,7 @@ | |||
30 | 30 | ||
31 | #define HASH_DEFAULT_SIZE 64UL | 31 | #define HASH_DEFAULT_SIZE 64UL |
32 | #define HASH_MIN_SIZE 4U | 32 | #define HASH_MIN_SIZE 4U |
33 | #define BUCKET_LOCKS_PER_CPU 128UL | 33 | #define BUCKET_LOCKS_PER_CPU 32UL |
34 | 34 | ||
35 | static u32 head_hashfn(struct rhashtable *ht, | 35 | static u32 head_hashfn(struct rhashtable *ht, |
36 | const struct bucket_table *tbl, | 36 | const struct bucket_table *tbl, |
@@ -70,7 +70,7 @@ static int alloc_bucket_locks(struct rhashtable *ht, struct bucket_table *tbl, | |||
70 | unsigned int nr_pcpus = num_possible_cpus(); | 70 | unsigned int nr_pcpus = num_possible_cpus(); |
71 | #endif | 71 | #endif |
72 | 72 | ||
73 | nr_pcpus = min_t(unsigned int, nr_pcpus, 32UL); | 73 | nr_pcpus = min_t(unsigned int, nr_pcpus, 64UL); |
74 | size = roundup_pow_of_two(nr_pcpus * ht->p.locks_mul); | 74 | size = roundup_pow_of_two(nr_pcpus * ht->p.locks_mul); |
75 | 75 | ||
76 | /* Never allocate more than 0.5 locks per bucket */ | 76 | /* Never allocate more than 0.5 locks per bucket */ |
@@ -83,6 +83,9 @@ static int alloc_bucket_locks(struct rhashtable *ht, struct bucket_table *tbl, | |||
83 | tbl->locks = vmalloc(size * sizeof(spinlock_t)); | 83 | tbl->locks = vmalloc(size * sizeof(spinlock_t)); |
84 | else | 84 | else |
85 | #endif | 85 | #endif |
86 | if (gfp != GFP_KERNEL) | ||
87 | gfp |= __GFP_NOWARN | __GFP_NORETRY; | ||
88 | |||
86 | tbl->locks = kmalloc_array(size, sizeof(spinlock_t), | 89 | tbl->locks = kmalloc_array(size, sizeof(spinlock_t), |
87 | gfp); | 90 | gfp); |
88 | if (!tbl->locks) | 91 | if (!tbl->locks) |