Make kqpoll_dequeue() usable with lazy removal of knotes
authorvisa <visa@openbsd.org>
Thu, 22 Jul 2021 07:22:43 +0000 (07:22 +0000)
committervisa <visa@openbsd.org>
Thu, 22 Jul 2021 07:22:43 +0000 (07:22 +0000)
commit4c262a92358f8545dda4e548e64ec26919de7a3a
tree66d8dbf44e8ad14b89a058787a6eac1a4bae1a21
parent4ba63a1b545780b48624520d82b207f0bc4ab8df
Make kqpoll_dequeue() usable with lazy removal of knotes

Adjust kqpoll_dequeue() so that it will clear only badfd knotes when
called from kqpoll_init(). This is needed by kqpoll's lazy removal
of knotes. Eager removal in kqpoll_dequeue() would defeat kqpoll's
attempt to reuse previously established knotes under workloads where
knote activation tends to occur already before next kqpoll scan.

Prompted by mpi@
sys/kern/kern_event.c