tcp: properly initialize tcp memory limits part 2 (fix nfs regression)
Subsystems (3)
PATCH 1/1 tcp: properly initialize tcp memory limits part 2 (fix nfs regression)
From: Sergei Trofimovich <[email protected]>
The commit introduced NFS file transfer hangup (proved by bisection).
Quoted 6 lines
Commit
4acb4190tries to fix the using uninitialized value introduced by commit 3dc43e3, but it would make the per-socket memory limits too small.This patch fixes this and also remove the redundant codes introduced in
4acb4190.
The change looks like a typo (division flipped to multiplication):
Quoted 2 lines
limit =
nr_free_buffer_pages()/ 8;
limit =nr_free_buffer_pages()<< (PAGE_SHIFT- 10);
Patch restores division.
CC Jason Wang <[email protected]>
CC Glauber Costa <[email protected]>
CC David S. Miller <[email protected]>
Signed-off-by Sergei Trofimovich <[email protected]>
Tested-by Sergei Trofimovich <[email protected]>
--- net/ipv4/tcp.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
net/ipv4/tcp.c +1 -1
@@ -3299,7 +3299,7 @@ void __init tcp_init(void)tcp_init_mem (&init_net);/* Set per-socket limits to no more than 1/128 the pressure threshold */ - limit =nr_free_buffer_pages () << (PAGE_SHIFT -10 ); + limit =nr_free_buffer_pages () >> (PAGE_SHIFT -10 ); limit =max (limit,128UL ); max_share =min (4UL *1024 *1024 , limit);
Signature · 1 line
1.7.8.5