]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
select: replace reference counting with memory barriers in selfd
authorMateusz Guzik <mjg@FreeBSD.org>
Mon, 16 Nov 2020 03:09:18 +0000 (03:09 +0000)
committerMateusz Guzik <mjg@FreeBSD.org>
Mon, 16 Nov 2020 03:09:18 +0000 (03:09 +0000)
commit31b2ac4b5a7f7a189355e23f8f9cdec5cda035cc
tree518df4cba10b397a87bf31bbcec6e251823ab737
parent2406f943a8ecc97db8967fffa0d6a2ed59b8d664
select: replace reference counting with memory barriers in selfd

Refcounting was added to combat a race between selfdfree and doselwakup,
but it adds avoidable overhead.

selfdfree detects it can free the object by ->sf_si == NULL, thus we can
ensure that the condition only holds after all accesses are completed.
sys/kern/sys_generic.c