inpcb: Push porthash token down a bit and use atomic op to update lastport
commit327bf46d96c0335f81ffe377f0c9817b34c1dd4b
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Fri, 4 Dec 2015 08:47:12 +0000 (4 16:47 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 7 Dec 2015 06:18:06 +0000 (7 14:18 +0800)
treed7c2a72161180ceed74868de51638aefef22faec
parent20cf2291b7b758fecda6e4e8f0a11effbc91c226
inpcb: Push porthash token down a bit and use atomic op to update lastport

This paves the way to use pooled token for porthash list head.

Even just with this commit, porthash token contention is reduced by 20K/s
on 12core/24threads system when running tools/kq_connect_client.
sys/netinet/in_pcb.c
sys/netinet/in_pcb.h
sys/netinet6/in6_src.c