udp: Optimize detach path
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 29 Sep 2014 12:18:46 +0000 (20:18 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 29 Sep 2014 12:18:46 +0000 (20:18 +0800)
commit684247a4618a7ee47413216b43509d2816d6f399
tree3e9bea64f1589fed1da6c737a733654c3ff5b222
parent26641eb6a79a553f3ada04509aca0c8ba321cb49
udp: Optimize detach path

If the inpcb was never put onto wildcard hash and the multicast options
were never accessed nor modified, we could directly dispose the inpcb
on detach path instead of going through all netisrs to make sure that
it is no longer being accessed.

After this commit 'kq_connect_client -u' gives ~180Kconns/s instead of
~160Kconns/s (~12% improvement).
sys/netinet/in_pcb.h
sys/netinet/in_proto.c
sys/netinet/udp_usrreq.c
sys/netinet/udp_var.h