aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2004-06-30 23:58:10 -0700
committerDavid S. Miller <davem@nuts.davemloft.net>2004-06-30 23:58:10 -0700
commit90d90ae3132f22bf526745d913c41448250165e3 (patch)
tree56c8a1488e57c44f3e6fb2ce7bbc42de9f0c84d5 /net
parentda829c388d48e5a87a734a5420ce92a875720d7e (diff)
downloadhistory-90d90ae3132f22bf526745d913c41448250165e3.tar.gz
[TCP]: TCP acts like it is always out of memory.
Current 2.6.7 tree acts as if it is alway under memory pressure because a recent change did a s/tcp_memory_pressure/tcp_prot.memory_pressure/. The problem is tcp_prot.memory_pressure is a pointer, so it is always non-zero! Rather than using *tcp_prot.memory_pressure, just go back to looking at tcp_memory_pressure. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: David S. Miller <davem@redhat.com>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/tcp_input.c8
-rw-r--r--net/ipv4/tcp_output.c2
-rw-r--r--net/ipv4/tcp_timer.c2
3 files changed, 6 insertions, 6 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 56f86c5ddb93e6..fd6cc97a446eb9 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -259,7 +259,7 @@ tcp_grow_window(struct sock *sk, struct tcp_opt *tp, struct sk_buff *skb)
/* Check #1 */
if (tp->rcv_ssthresh < tp->window_clamp &&
(int)tp->rcv_ssthresh < tcp_space(sk) &&
- !tcp_prot.memory_pressure) {
+ !tcp_memory_pressure) {
int incr;
/* Check #2. Increase window, if skb with such overhead
@@ -349,7 +349,7 @@ static void tcp_clamp_window(struct sock *sk, struct tcp_opt *tp)
if (ofo_win) {
if (sk->sk_rcvbuf < sysctl_tcp_rmem[2] &&
!(sk->sk_userlocks & SOCK_RCVBUF_LOCK) &&
- !tcp_prot.memory_pressure &&
+ !tcp_memory_pressure &&
atomic_read(&tcp_memory_allocated) < sysctl_tcp_mem[0])
sk->sk_rcvbuf = min(atomic_read(&sk->sk_rmem_alloc),
sysctl_tcp_rmem[2]);
@@ -3764,7 +3764,7 @@ static int tcp_prune_queue(struct sock *sk)
if (atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf)
tcp_clamp_window(sk, tp);
- else if (tcp_prot.memory_pressure)
+ else if (tcp_memory_pressure)
tp->rcv_ssthresh = min(tp->rcv_ssthresh, 4U * tp->advmss);
tcp_collapse_ofo_queue(sk);
@@ -3844,7 +3844,7 @@ static void tcp_new_space(struct sock *sk)
if (tp->packets_out < tp->snd_cwnd &&
!(sk->sk_userlocks & SOCK_SNDBUF_LOCK) &&
- !tcp_prot.memory_pressure &&
+ !tcp_memory_pressure &&
atomic_read(&tcp_memory_allocated) < sysctl_tcp_mem[0]) {
int sndmem = max_t(u32, tp->mss_clamp, tp->mss_cache) +
MAX_TCP_HEADER + 16 + sizeof(struct sk_buff),
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index b6203742f97fb3..1fbe1edbba7b96 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -672,7 +672,7 @@ u32 __tcp_select_window(struct sock *sk)
if (free_space < full_space/2) {
tp->ack.quick = 0;
- if (tcp_prot.memory_pressure)
+ if (tcp_memory_pressure)
tp->rcv_ssthresh = min(tp->rcv_ssthresh, 4U*tp->advmss);
if (free_space < mss)
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index 840f621886c843..1b8fe67e65f4ce 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -257,7 +257,7 @@ static void tcp_delack_timer(unsigned long data)
TCP_CHECK_TIMER(sk);
out:
- if (tcp_prot.memory_pressure)
+ if (tcp_memory_pressure)
sk_stream_mem_reclaim(sk);
out_unlock:
bh_unlock_sock(sk);