aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_timer.c
diff options
context:
space:
mode:
authorHideo Aoki <haoki@redhat.com>2007-12-31 03:11:19 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:00:18 -0500
commit3ab224be6d69de912ee21302745ea45a99274dbc (patch)
tree335dcef1cfacfefe3f36c21d5f144e011bc3bfba /net/ipv4/tcp_timer.c
parenta06b494b61de44617dd58612164bdde56fca7bfb (diff)
[NET] CORE: Introducing new memory accounting interface.
This patch introduces new memory accounting functions for each network protocol. Most of them are renamed from memory accounting functions for stream protocols. At the same time, some stream memory accounting functions are removed since other functions do same thing. Renaming: sk_stream_free_skb() -> sk_wmem_free_skb() __sk_stream_mem_reclaim() -> __sk_mem_reclaim() sk_stream_mem_reclaim() -> sk_mem_reclaim() sk_stream_mem_schedule -> __sk_mem_schedule() sk_stream_pages() -> sk_mem_pages() sk_stream_rmem_schedule() -> sk_rmem_schedule() sk_stream_wmem_schedule() -> sk_wmem_schedule() sk_charge_skb() -> sk_mem_charge() Removeing sk_stream_rfree(): consolidates into sock_rfree() sk_stream_set_owner_r(): consolidates into skb_set_owner_r() sk_stream_mem_schedule() The following functions are added. sk_has_account(): check if the protocol supports accounting sk_mem_uncharge(): do the opposite of sk_mem_charge() In addition, to achieve consolidation, updating sk_wmem_queued is removed from sk_mem_charge(). Next, to consolidate memory accounting functions, this patch adds memory accounting calls to network core functions. Moreover, present memory accounting call is renamed to new accounting call. Finally we replace present memory accounting calls with new interface in TCP and SCTP. Signed-off-by: Takahiro Yasui <tyasui@redhat.com> Signed-off-by: Hideo Aoki <haoki@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_timer.c')
-rw-r--r--net/ipv4/tcp_timer.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index ea85bc00c61f..17931be6d584 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -186,7 +186,7 @@ static void tcp_delack_timer(unsigned long data)
186 goto out_unlock; 186 goto out_unlock;
187 } 187 }
188 188
189 sk_stream_mem_reclaim(sk); 189 sk_mem_reclaim(sk);
190 190
191 if (sk->sk_state == TCP_CLOSE || !(icsk->icsk_ack.pending & ICSK_ACK_TIMER)) 191 if (sk->sk_state == TCP_CLOSE || !(icsk->icsk_ack.pending & ICSK_ACK_TIMER))
192 goto out; 192 goto out;
@@ -226,7 +226,7 @@ static void tcp_delack_timer(unsigned long data)
226 226
227out: 227out:
228 if (tcp_memory_pressure) 228 if (tcp_memory_pressure)
229 sk_stream_mem_reclaim(sk); 229 sk_mem_reclaim(sk);
230out_unlock: 230out_unlock:
231 bh_unlock_sock(sk); 231 bh_unlock_sock(sk);
232 sock_put(sk); 232 sock_put(sk);
@@ -420,7 +420,7 @@ static void tcp_write_timer(unsigned long data)
420 TCP_CHECK_TIMER(sk); 420 TCP_CHECK_TIMER(sk);
421 421
422out: 422out:
423 sk_stream_mem_reclaim(sk); 423 sk_mem_reclaim(sk);
424out_unlock: 424out_unlock:
425 bh_unlock_sock(sk); 425 bh_unlock_sock(sk);
426 sock_put(sk); 426 sock_put(sk);
@@ -514,7 +514,7 @@ static void tcp_keepalive_timer (unsigned long data)
514 } 514 }
515 515
516 TCP_CHECK_TIMER(sk); 516 TCP_CHECK_TIMER(sk);
517 sk_stream_mem_reclaim(sk); 517 sk_mem_reclaim(sk);
518 518
519resched: 519resched:
520 inet_csk_reset_keepalive_timer (sk, elapsed); 520 inet_csk_reset_keepalive_timer (sk, elapsed);