When setting up a socket in socreate(), there's no need to lock the
socket lock around knlist_init(), so don't. Hard code the setting of the socket reference count to 1 rather than using soref() to avoid asserting the socket lock, since we've not yet exposed the socket to other threads. This removes two mutex operations from each socket allocation.
This commit is contained in:
parent
5fab68b19e
commit
2b37548a71
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=143422
@ -211,11 +211,9 @@ socreate(dom, aso, type, proto, cred, td)
|
||||
#ifdef MAC
|
||||
mac_create_socket(cred, so);
|
||||
#endif
|
||||
SOCK_LOCK(so);
|
||||
knlist_init(&so->so_rcv.sb_sel.si_note, SOCKBUF_MTX(&so->so_rcv));
|
||||
knlist_init(&so->so_snd.sb_sel.si_note, SOCKBUF_MTX(&so->so_snd));
|
||||
soref(so);
|
||||
SOCK_UNLOCK(so);
|
||||
so->so_count = 1;
|
||||
error = (*prp->pr_usrreqs->pru_attach)(so, proto, td);
|
||||
if (error) {
|
||||
ACCEPT_LOCK();
|
||||
|
Loading…
Reference in New Issue
Block a user