mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-21 18:11:39 +00:00
tcp: use alloc_large_system_hash() to allocate table_perturb
[ Upstream commite67b72b90b
] 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:e926147618
("tcp: dynamically allocate the perturb table used by source ports") Signed-off-by: Muchun Song <songmuchun@bytedance.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Link: https://lore.kernel.org/r/20220607070214.94443-1-songmuchun@bytedance.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
9b18f01a51
commit
9c1fb2e938
1 changed files with 6 additions and 4 deletions
|
@ -917,10 +917,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)
|
||||
|
|
Loading…
Reference in a new issue