diff options
author | gnn <gnn@FreeBSD.org> | 2015-04-14 14:22:34 +0000 |
---|---|---|
committer | gnn <gnn@FreeBSD.org> | 2015-04-14 14:22:34 +0000 |
commit | de9078cbfaabd043bf0ec4a70001621fb7c98dcd (patch) | |
tree | 73c0090bfdcde975a700fe27cafeb777ff18d61b /sys/kern | |
parent | cbac2d0bca920a7c215b3025f48d6f679fff6df6 (diff) | |
download | FreeBSD-src-de9078cbfaabd043bf0ec4a70001621fb7c98dcd.zip FreeBSD-src-de9078cbfaabd043bf0ec4a70001621fb7c98dcd.tar.gz |
When a kernel has DEVICE_POLLING turned on but no drivers have
the capability do not try to take the mutex at all.
Replaces misbegotten attempt from reverted commit 281276
Pointed out by: glebius
Sponsored by: Rubicon Communications (Netgate)
Differential Revision: https://reviews.freebsd.org/D2262
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_poll.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/kern/kern_poll.c b/sys/kern/kern_poll.c index 04b4e79..5aa12f0 100644 --- a/sys/kern/kern_poll.c +++ b/sys/kern/kern_poll.c @@ -367,6 +367,9 @@ netisr_pollmore() struct timeval t; int kern_load; + if (poll_handlers == 0) + return; + mtx_lock(&poll_mtx); if (!netisr_pollmore_scheduled) { mtx_unlock(&poll_mtx); @@ -424,6 +427,9 @@ netisr_poll(void) int i, cycles; enum poll_cmd arg = POLL_ONLY; + if (poll_handlers == 0) + return; + mtx_lock(&poll_mtx); if (!netisr_poll_scheduled) { mtx_unlock(&poll_mtx); |