summaryrefslogtreecommitdiff
path: root/usr.bin/vmstat
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2019-11-07 08:03:19 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2019-11-07 08:03:19 +0000
commit21d5fb1156f1a9b50d8577aa316ed3939e987877 (patch)
treeb2813c73991e91c1a244b2c3c8e9119912203763 /usr.bin/vmstat
parent37888cbb216c3b0a4b8628e4f5b1f49605c2ff56 (diff)
serialise hook adds and dels with a mutex instead of an implicit NET_LOCK.
i had NET_ASSERT_LOCKED() in the hook add and remove operations, because that's what's held when the hooks are run. some callers do not hold the NET_LOCK when calling them though, eg, bridge(4). aggr and tpmr used to not hold NET_LOCK while being destroyed, which also caused the asserts to fire, so i moved the port destroys inside NET_LOCK, but now I have deadlocks with some barrier calls. the hooks having their own lock means callers don't have to hold NET_LOCK and the list will stay sane. the code that runs the hooks gives up the mutex when calling the hook, but keeps track of where it's up to bey putting a cursor in the list. there's a single global mutex for all the interface linkstate and detach hooks, but this stuff isn't a hot path by any stretch of the imagination. based on (a lot of) testing by hrvoje popovski. thank you.
Diffstat (limited to 'usr.bin/vmstat')
0 files changed, 0 insertions, 0 deletions