diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2021-11-06 05:48:48 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2021-11-06 05:48:48 +0000 |
commit | 5155a287d400e5d529dcae2c2a93f9d298b75463 (patch) | |
tree | c1f5a757f678117b13ee00a41a74211b3e463406 /etc/mtree/special | |
parent | 050fdf90f8fece4f71708c1c4b9da22eb0e54775 (diff) |
Make kqread event filter MP-safe
Use the monitored kqueue's kq_lock to serialize kqueue and knote access.
Typically, the "object lock" would cover also the klist, but that is not
possible with kqueues. knote_activate() needs kq_lock of the monitoring
kqueue, which would create lock order troubles if kq_lock was held when
calling KNOTE(&kq->kq_sel.si_note). Avoid this by using a separate klist
lock for kqueues.
The new klist lock is system-wide. Each kqueue instance could have
a dedicated klist lock. However, the efficacy of dedicated versus
system-wide lock is somewhat limited because the current implementation
activates kqueue knotes through a single thread.
OK mpi@
Diffstat (limited to 'etc/mtree/special')
0 files changed, 0 insertions, 0 deletions