@@ -130,7 +130,8 @@ static union nested_table *nested_table_alloc(struct rhashtable *ht,
130
130
if (ntbl )
131
131
return ntbl ;
132
132
133
- ntbl = kzalloc (PAGE_SIZE , GFP_ATOMIC );
133
+ ntbl = alloc_hooks_tag (ht -> alloc_tag ,
134
+ kmalloc_noprof (PAGE_SIZE , GFP_ATOMIC |__GFP_ZERO ));
134
135
135
136
if (ntbl && leaf ) {
136
137
for (i = 0 ; i < PAGE_SIZE / sizeof (ntbl [0 ]); i ++ )
@@ -157,7 +158,8 @@ static struct bucket_table *nested_bucket_table_alloc(struct rhashtable *ht,
157
158
158
159
size = sizeof (* tbl ) + sizeof (tbl -> buckets [0 ]);
159
160
160
- tbl = kzalloc (size , gfp );
161
+ tbl = alloc_hooks_tag (ht -> alloc_tag ,
162
+ kmalloc_noprof (size , gfp |__GFP_ZERO ));
161
163
if (!tbl )
162
164
return NULL ;
163
165
@@ -181,7 +183,9 @@ static struct bucket_table *bucket_table_alloc(struct rhashtable *ht,
181
183
int i ;
182
184
static struct lock_class_key __key ;
183
185
184
- tbl = kvzalloc (struct_size (tbl , buckets , nbuckets ), gfp );
186
+ tbl = alloc_hooks_tag (ht -> alloc_tag ,
187
+ kvmalloc_node_noprof (struct_size (tbl , buckets , nbuckets ),
188
+ gfp |__GFP_ZERO , NUMA_NO_NODE ));
185
189
186
190
size = nbuckets ;
187
191
@@ -1016,7 +1020,7 @@ static u32 rhashtable_jhash2(const void *key, u32 length, u32 seed)
1016
1020
* .obj_hashfn = my_hash_fn,
1017
1021
* };
1018
1022
*/
1019
- int rhashtable_init (struct rhashtable * ht ,
1023
+ int rhashtable_init_noprof (struct rhashtable * ht ,
1020
1024
const struct rhashtable_params * params )
1021
1025
{
1022
1026
struct bucket_table * tbl ;
@@ -1031,6 +1035,8 @@ int rhashtable_init(struct rhashtable *ht,
1031
1035
spin_lock_init (& ht -> lock );
1032
1036
memcpy (& ht -> p , params , sizeof (* params ));
1033
1037
1038
+ alloc_tag_record (ht -> alloc_tag );
1039
+
1034
1040
if (params -> min_size )
1035
1041
ht -> p .min_size = roundup_pow_of_two (params -> min_size );
1036
1042
@@ -1076,7 +1082,7 @@ int rhashtable_init(struct rhashtable *ht,
1076
1082
1077
1083
return 0 ;
1078
1084
}
1079
- EXPORT_SYMBOL_GPL (rhashtable_init );
1085
+ EXPORT_SYMBOL_GPL (rhashtable_init_noprof );
1080
1086
1081
1087
/**
1082
1088
* rhltable_init - initialize a new hash list table
@@ -1087,15 +1093,15 @@ EXPORT_SYMBOL_GPL(rhashtable_init);
1087
1093
*
1088
1094
* See documentation for rhashtable_init.
1089
1095
*/
1090
- int rhltable_init (struct rhltable * hlt , const struct rhashtable_params * params )
1096
+ int rhltable_init_noprof (struct rhltable * hlt , const struct rhashtable_params * params )
1091
1097
{
1092
1098
int err ;
1093
1099
1094
- err = rhashtable_init (& hlt -> ht , params );
1100
+ err = rhashtable_init_noprof (& hlt -> ht , params );
1095
1101
hlt -> ht .rhlist = true;
1096
1102
return err ;
1097
1103
}
1098
- EXPORT_SYMBOL_GPL (rhltable_init );
1104
+ EXPORT_SYMBOL_GPL (rhltable_init_noprof );
1099
1105
1100
1106
static void rhashtable_free_one (struct rhashtable * ht , struct rhash_head * obj ,
1101
1107
void (* free_fn )(void * ptr , void * arg ),
0 commit comments