svn commit: r193209 - projects/pnet/sys/net
Robert Watson
rwatson at FreeBSD.org
Mon Jun 1 08:32:26 UTC 2009
Author: rwatson
Date: Mon Jun 1 08:32:24 2009
New Revision: 193209
URL: http://svn.freebsd.org/changeset/base/193209
Log:
Count wakeups sent and wakeups processed for netisr workstreams.
Modified:
projects/pnet/sys/net/netisr.c
Modified: projects/pnet/sys/net/netisr.c
==============================================================================
--- projects/pnet/sys/net/netisr.c Mon Jun 1 08:17:00 2009 (r193208)
+++ projects/pnet/sys/net/netisr.c Mon Jun 1 08:32:24 2009 (r193209)
@@ -248,6 +248,8 @@ struct netisr_workstream {
u_int nws_cpu; /* CPU pinning. */
u_int nws_flags; /* Wakeup flags. */
u_int nws_pendingbits; /* Scheduled protocols. */
+ u_int64_t nws_wakeupssent; /* How many times scheduled. */
+ u_int64_t nws_wakeups; /* How many times woken up. */
/*
* Each protocol has per-workstream data.
@@ -290,7 +292,11 @@ SYSCTL_INT(_net_isr, OID_AUTO, numthread
#define NWS_LOCK(s) mtx_lock(&(s)->nws_mtx)
#define NWS_LOCK_ASSERT(s) mtx_assert(&(s)->nws_mtx, MA_OWNED)
#define NWS_UNLOCK(s) mtx_unlock(&(s)->nws_mtx)
-#define NWS_SIGNAL(s) swi_sched((s)->nws_swi_cookie, 0)
+#define NWS_SIGNAL(s) do { \
+ (s)->nws_wakeupssent++; \
+ swi_sched((s)->nws_swi_cookie, 0); \
+} while (0)
+
/*
* Utility routines for protocols that implement their own mapping of flows
@@ -732,6 +738,7 @@ swi_net(void *arg)
NETISR_RLOCK(&tracker);
#endif
NWS_LOCK(nwsp);
+ nwsp->nws_wakeups++;
KASSERT(!(nwsp->nws_flags & NWS_RUNNING), ("swi_net: running"));
if (nwsp->nws_flags & NWS_DISPATCHING)
goto out;
More information about the svn-src-projects
mailing list