aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMuchun Song <[email protected]>2022-06-07 07:02:14 +0000
committerJakub Kicinski <[email protected]>2022-06-09 04:11:05 +0000
commite67b72b90b7e19a4be4d9c29f3feea6f58ab43f8 (patch)
treea232794a09252948f6444b0917c61d90fee5cacc
parentnet: dsa: realtek: rtl8365mb: fix GMII caps for ports with internal PHY (diff)
downloadkernel-e67b72b90b7e19a4be4d9c29f3feea6f58ab43f8.tar.gz
kernel-e67b72b90b7e19a4be4d9c29f3feea6f58ab43f8.zip
tcp: use alloc_large_system_hash() to allocate table_perturb
In our server, there may be no high order (>= 6) memory since we reserve lots of HugeTLB pages when booting. Then the system panic. So use alloc_large_system_hash() to allocate table_perturb. Fixes: e9261476184b ("tcp: dynamically allocate the perturb table used by source ports") Signed-off-by: Muchun Song <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
-rw-r--r--net/ipv4/inet_hashtables.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c
index e8de5e699b3f..545f91b6cb5e 100644
--- a/net/ipv4/inet_hashtables.c
+++ b/net/ipv4/inet_hashtables.c
@@ -1026,10 +1026,12 @@ void __init inet_hashinfo2_init(struct inet_hashinfo *h, const char *name,
init_hashinfo_lhash2(h);
/* this one is used for source ports of outgoing connections */
- table_perturb = kmalloc_array(INET_TABLE_PERTURB_SIZE,
- sizeof(*table_perturb), GFP_KERNEL);
- if (!table_perturb)
- panic("TCP: failed to alloc table_perturb");
+ table_perturb = alloc_large_system_hash("Table-perturb",
+ sizeof(*table_perturb),
+ INET_TABLE_PERTURB_SIZE,
+ 0, 0, NULL, NULL,
+ INET_TABLE_PERTURB_SIZE,
+ INET_TABLE_PERTURB_SIZE);
}
int inet_hashinfo2_init_mod(struct inet_hashinfo *h)