diff options
author | George V. Neville-Neil <gnn@FreeBSD.org> | 2015-04-14 14:22:34 +0000 |
---|---|---|
committer | George V. Neville-Neil <gnn@FreeBSD.org> | 2015-04-14 14:22:34 +0000 |
commit | 63bf240482b9b361299d9d20963f1eacad1a933b (patch) | |
tree | 73c0090bfdcde975a700fe27cafeb777ff18d61b /sys/kern/kern_poll.c | |
parent | 3f06facc8a6bd239678fcc517a4cba31c84ae025 (diff) | |
download | src-63bf240482b9b361299d9d20963f1eacad1a933b.tar.gz src-63bf240482b9b361299d9d20963f1eacad1a933b.zip |
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
Notes
Notes:
svn path=/head/; revision=281528
Diffstat (limited to 'sys/kern/kern_poll.c')
-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 04b4e7936a1e..5aa12f05edd1 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); |