Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 23663
b: refs/heads/master
c: 7b4f4b5
h: refs/heads/master
i:
  23661: 4d3fb1b
  23659: 9fc4694
  23655: 3ed5017
  23647: c5c412c
v: v3
  • Loading branch information
John Heffner authored and David S. Miller committed Mar 25, 2006
1 parent 3b1fce0 commit a2a1f74
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2babf9daae4a3561f3264638a22ac7d0b14a6f52
refs/heads/master: 7b4f4b5ebceab67ce440a61081a69f0265e17c2a
23 changes: 14 additions & 9 deletions trunk/net/ipv4/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ atomic_t tcp_orphan_count = ATOMIC_INIT(0);
EXPORT_SYMBOL_GPL(tcp_orphan_count);

int sysctl_tcp_mem[3];
int sysctl_tcp_wmem[3] = { 4 * 1024, 16 * 1024, 128 * 1024 };
int sysctl_tcp_rmem[3] = { 4 * 1024, 87380, 87380 * 2 };
int sysctl_tcp_wmem[3];
int sysctl_tcp_rmem[3];

EXPORT_SYMBOL(sysctl_tcp_mem);
EXPORT_SYMBOL(sysctl_tcp_rmem);
Expand Down Expand Up @@ -2081,7 +2081,8 @@ __setup("thash_entries=", set_thash_entries);
void __init tcp_init(void)
{
struct sk_buff *skb = NULL;
int order, i;
unsigned long limit;
int order, i, max_share;

if (sizeof(struct tcp_skb_cb) > sizeof(skb->cb))
__skb_cb_too_small_for_tcp(sizeof(struct tcp_skb_cb),
Expand Down Expand Up @@ -2155,12 +2156,16 @@ void __init tcp_init(void)
sysctl_tcp_mem[1] = 1024 << order;
sysctl_tcp_mem[2] = 1536 << order;

if (order < 3) {
sysctl_tcp_wmem[2] = 64 * 1024;
sysctl_tcp_rmem[0] = PAGE_SIZE;
sysctl_tcp_rmem[1] = 43689;
sysctl_tcp_rmem[2] = 2 * 43689;
}
limit = ((unsigned long)sysctl_tcp_mem[1]) << (PAGE_SHIFT - 7);
max_share = min(4UL*1024*1024, limit);

sysctl_tcp_wmem[0] = SK_STREAM_MEM_QUANTUM;
sysctl_tcp_wmem[1] = 16*1024;
sysctl_tcp_wmem[2] = max(64*1024, max_share);

sysctl_tcp_rmem[0] = SK_STREAM_MEM_QUANTUM;
sysctl_tcp_rmem[1] = 87380;
sysctl_tcp_rmem[2] = max(87380, max_share);

printk(KERN_INFO "TCP: Hash tables configured "
"(established %d bind %d)\n",
Expand Down

0 comments on commit a2a1f74

Please sign in to comment.