[PATCH][RFC 4] cleaning up struct sock

From: Arnaldo Carvalho de Melo (acme@conectiva.com.br)
Date: Fri Dec 21 2001 - 22:28:24 EST


Em Fri, Dec 21, 2001 at 11:54:38AM -0200, Arnaldo Carvalho de Melo escreveu:
> Em Thu, Dec 20, 2001 at 12:21:26AM -0800, David S. Miller escreveu:
> > I'd rather you pass the "kmem_cache_t" directly into sk_alloc, use
> > NULL for "I don't have any extra private area".
> >
> > And then, for the IP case lay it out like this:
> >
> > struct sock
> > struct ip_opt
> > struct {tcp,raw4,...}_opt
> >
> > And use different kmem_cache_t's for each protocol instead of
> > the same one for tcp, raw4, etc.
> >
> > RAW/UDP sockets waste a lot of space with your current layout.

Done, patch available at:

http://www.kernel.org/pub/linux/kernel/people/acme/v2.5/2.5.2-pre1/
sock.cleanup-2.5.2-pre1.bz2

Current state of /proc/slabinfo:

[acme@rama2 acme]$ grep sock /proc/slabinfo
unix_sock 7 20 400 1 2 1 : 17 572 2 0 0
raw4_sock 0 10 376 0 1 1 : 1 3 1 0 0
udp_sock 6 10 372 1 1 1 : 7 31 1 0 0
tcp_sock 13 15 800 3 3 1 : 14 47 3 0 0
sock 0 0 336 0 0 1 : 0 0 0 0 0

TODO: do the same for IPv6, that now has only one slabcache for all its
protocols.

- Arnaldo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Dec 23 2001 - 21:00:26 EST