Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 98558
b: refs/heads/master
c: 57413eb
h: refs/heads/master
v: v3
  • Loading branch information
Miquel van Smoorenburg authored and David S. Miller committed Jun 28, 2008
1 parent dd286b6 commit 321653e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 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: 479798211967cd828e09ce27775b8cbfe99462ab
refs/heads/master: 57413ebc4e0f1e471a3b4db4aff9a85c083d090e
9 changes: 6 additions & 3 deletions trunk/net/ipv4/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@
#include <linux/socket.h>
#include <linux/random.h>
#include <linux/bootmem.h>
#include <linux/highmem.h>
#include <linux/swap.h>
#include <linux/cache.h>
#include <linux/err.h>
#include <linux/crypto.h>
Expand Down Expand Up @@ -2620,7 +2622,7 @@ __setup("thash_entries=", set_thash_entries);
void __init tcp_init(void)
{
struct sk_buff *skb = NULL;
unsigned long limit;
unsigned long nr_pages, limit;
int order, i, max_share;

BUILD_BUG_ON(sizeof(struct tcp_skb_cb) > sizeof(skb->cb));
Expand Down Expand Up @@ -2689,8 +2691,9 @@ void __init tcp_init(void)
* is up to 1/2 at 256 MB, decreasing toward zero with the amount of
* memory, with a floor of 128 pages.
*/
limit = min(nr_all_pages, 1UL<<(28-PAGE_SHIFT)) >> (20-PAGE_SHIFT);
limit = (limit * (nr_all_pages >> (20-PAGE_SHIFT))) >> (PAGE_SHIFT-11);
nr_pages = totalram_pages - totalhigh_pages;
limit = min(nr_pages, 1UL<<(28-PAGE_SHIFT)) >> (20-PAGE_SHIFT);
limit = (limit * (nr_pages >> (20-PAGE_SHIFT))) >> (PAGE_SHIFT-11);
limit = max(limit, 128UL);
sysctl_tcp_mem[0] = limit / 4 * 3;
sysctl_tcp_mem[1] = limit;
Expand Down

0 comments on commit 321653e

Please sign in to comment.