svn commit: r281528 - head/sys/kern

George V. Neville-Neil gnn at FreeBSD.org
Tue Apr 14 14:22:35 UTC 2015


Author: gnn
Date: Tue Apr 14 14:22:34 2015
New Revision: 281528
URL: https://svnweb.freebsd.org/changeset/base/281528

Log:
  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

Modified:
  head/sys/kern/kern_poll.c

Modified: head/sys/kern/kern_poll.c
==============================================================================
--- head/sys/kern/kern_poll.c	Tue Apr 14 14:15:14 2015	(r281527)
+++ head/sys/kern/kern_poll.c	Tue Apr 14 14:22:34 2015	(r281528)
@@ -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);


More information about the svn-src-all mailing list