git: sosendudp: Try to optimize out the additional mbuf alloc on output path

Sepherosa Ziehau sephe at crater.dragonflybsd.org
Wed Nov 28 22:43:27 PST 2012


commit f5991d1f6f129c4fbf395d86ee27f35a8ad21ba8
Author: Sepherosa Ziehau <sephe at dragonflybsd.org>
Date:   Thu Nov 29 13:55:02 2012 +0800

    sosendudp: Try to optimize out the additional mbuf alloc on output path
    
    This optimization leaves enough space at the beginning of the mbuf, so
    later on M_PREPEND() probably will not allocate addition mbuf.
    
    This probably will not benefit any data that will be fragmented, e.g. by
    IPv4, so this optimization is only performed when the size of data and
    max size of protocol+link headers fit into one mbuf cluster.
    
    This optimization could be turned off by net.inet.udp.sosend_prepend,
    which is on by default.

Summary of changes:
 sys/kern/uipc_socket.c   |   42 +++++++++++++++++++++++++++++++++++++++---
 sys/netinet/udp_usrreq.c |    5 +++++
 2 files changed, 44 insertions(+), 3 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/f5991d1f6f129c4fbf395d86ee27f35a8ad21ba8


-- 
DragonFly BSD source repository



More information about the Commits mailing list