]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
netmap: don't schedule kqueue notify task when kqueue is not used
authorvmaffione <vmaffione@FreeBSD.org>
Mon, 18 Feb 2019 14:21:41 +0000 (14:21 +0000)
committervmaffione <vmaffione@FreeBSD.org>
Mon, 18 Feb 2019 14:21:41 +0000 (14:21 +0000)
commit23b439c4c0a1f5fad0c5764a2052aef3452cdfcd
tree8d27d1fcb340ef025618d9275e3fea92e54c21cc
parentbbe25730d0e36d65d496403e2b4e09809f16227b
netmap: don't schedule kqueue notify task when kqueue is not used

This change adds a counter (kqueue_users) to keep track of how many
kqueue users are referencing a given struct nm_selinfo.
In this way, nm_os_selwakeup() can schedule the kevent notification
task only when kqueue is actually being used.
This is important to avoid wasting CPU in the common case where
kqueue is not used.

Reviewed by: Aleksandr Fedorov <aleksandr.fedorov@itglobal.com>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D19177
sys/dev/netmap/netmap_freebsd.c
sys/dev/netmap/netmap_kern.h