Commit 12028f96 authored by David S. Miller's avatar David S. Miller

[NET]: Move sndmsg_page destruction back into TCP for now.

Signed-off-by: default avatarDavid S. Miller <davem@redhat.com>
parent 89a4a37e
...@@ -652,14 +652,6 @@ void sk_free(struct sock *sk) ...@@ -652,14 +652,6 @@ void sk_free(struct sock *sk)
printk(KERN_DEBUG "%s: optmem leakage (%d bytes) detected.\n", printk(KERN_DEBUG "%s: optmem leakage (%d bytes) detected.\n",
__FUNCTION__, atomic_read(&sk->sk_omem_alloc)); __FUNCTION__, atomic_read(&sk->sk_omem_alloc));
/*
* If sendmsg cached page exists, toss it.
*/
if (sk->sk_sndmsg_page) {
__free_page(sk->sk_sndmsg_page);
sk->sk_sndmsg_page = NULL;
}
security_sk_free(sk); security_sk_free(sk);
kmem_cache_free(sk->sk_slab, sk); kmem_cache_free(sk->sk_slab, sk);
module_put(owner); module_put(owner);
......
...@@ -2113,6 +2113,14 @@ int tcp_v4_destroy_sock(struct sock *sk) ...@@ -2113,6 +2113,14 @@ int tcp_v4_destroy_sock(struct sock *sk)
if (tp->bind_hash) if (tp->bind_hash)
tcp_put_port(sk); tcp_put_port(sk);
/*
* If sendmsg cached page exists, toss it.
*/
if (sk->sk_sndmsg_page) {
__free_page(sk->sk_sndmsg_page);
sk->sk_sndmsg_page = NULL;
}
atomic_dec(&tcp_sockets_allocated); atomic_dec(&tcp_sockets_allocated);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment