summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@conectiva.com.br>2004-09-13 14:05:28 -0300
committerArnaldo Carvalho de Melo <acme@conectiva.com.br>2004-09-13 14:05:28 -0300
commitc531454e26c39d77c721ee59d04bbe1dc0cca119 (patch)
tree5d1f1042f0d31e8b1e0bab2da3d27c160f7d8d15 /include/linux
parent664d4fca1f6637331b8d3c7ad51b38e626b0a9ab (diff)
[NET] generalise per protocol slab cache handling
With this patch we get two new slabcaches, for sctp socks, that previously were being allocated on the default, that was tcp[6]_sock, i.e. wasting 288 bytes per sock in the IPv4 case and 256 bytes for the IPv6 version, this is in preparation for DCCP (or any other new protocol :) ). With this in place another nice side effect that is easier to achieve is to get rid of struct sock sk->sk_slab, and instead use sk->sk_prot->slab, saving sizeof(void *) on every struct sock instance, but this unfortunatly has to wait for the conversion of all protocols that use per socket slabcaches to use sk->sk_prot, AF_UNIX is the only one AFAIK, so I'll try to convert it to use sk->sk_prot and then get rid of sk->sk_slab. As for the protocols that don't use per socket slabcaches its just a matter of defaulting to sk_cachep at sk_free time if sk->sk_prot is NULL. [root@qemu ~]# modprobe sctp [root@qemu ~]# grep _sock /proc/slabinfo sctpv6_sock 9 9 864 9 2 : tunables 54 27 0 : sctp_sock 0 0 736 5 1 : tunables 54 27 0 : rawv6_sock 3 6 640 6 1 : tunables 54 27 0 : udpv6_sock 0 0 608 6 1 : tunables 54 27 0 : tcpv6_sock 1 7 1120 7 2 : tunables 24 12 0 : unix_sock 6 10 384 10 1 : tunables 54 27 0 : raw_sock 2 8 480 8 1 : tunables 54 27 0 : udp_sock 0 0 512 7 1 : tunables 54 27 0 : tcp_sock 0 0 1024 4 1 : tunables 54 27 0 : Signed-off-by: Arnaldo Carvalho de Melo <acme@conectiva.com.br> Signed-off-by: David S. Miller <davem@redhat.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/ipv6.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index ccc084d370cd..55aba976aba6 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -282,6 +282,10 @@ static inline struct raw6_opt * raw6_sk(const struct sock *__sk)
return &((struct raw6_sock *)__sk)->raw6;
}
+struct ipv6_sk_offset {
+ int offset;
+};
+
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
#define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only)
#define ipv6_only_sock(sk) ((sk)->sk_family == PF_INET6 && __ipv6_only_sock(sk))