Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 May 2008 01:00:21 GMT
From:      Julian Elischer <julian@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 141617 for review
Message-ID:  <200805150100.m4F10LvE078787@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=141617

Change 141617 by julian@julian_trafmon1 on 2008/05/15 01:00:17

	revert back to the -current

Affected files ...

.. //depot/projects/vimage/src/sys/kern/kern_timeout.c#11 edit

Differences ...

==== //depot/projects/vimage/src/sys/kern/kern_timeout.c#11 (text+ko) ====

@@ -92,8 +92,6 @@
 struct callout_cpu cc_cpu;
 #define	CC_CPU(cpu)	&cc_cpu
 #define	CC_SELF()	&cc_cpu
-#ifdef INVARIANTS
-static int callwheel_initialized = 0;
 #endif
 #define	CC_LOCK(cc)	mtx_lock_spin(&(cc)->cc_lock)
 #define	CC_UNLOCK(cc)	mtx_unlock_spin(&(cc)->cc_lock)
@@ -123,7 +121,8 @@
  * kern_timeout_callwheel_alloc() - kernel low level callwheel initialization 
  *
  *	This code is called very early in the kernel initialization sequence,
- *	and may be called more then once.
+ *	and may be called more then once. This claims some memory for this
+ * 	module and return the start of the remaining memory.
  */
 caddr_t
 kern_timeout_callwheel_alloc(caddr_t v)
@@ -172,7 +171,7 @@
 /*
  * kern_timeout_callwheel_init() - initialize previously reserved callwheel
  *				   space.
- *
+ * 
  *	This code is called just once, after the space reserved for the
  *	callout wheel has been finalized.
  */
@@ -216,10 +215,6 @@
 		    M_WAITOK);
 		callout_cpu_init(cc);
 	}
-	}
-	mtx_init(&callout_lock, "callout", NULL, MTX_SPIN | MTX_RECURSE);
-#ifdef INVARIANTS
-	callwheel_initialized = 1;
 #endif
 }
 
@@ -752,36 +747,12 @@
 	return (1);
 }
 
-#ifdef INVARIANTS
-/*
- * Examine the entire callwhell before initializing a new handle,
- * and panic if the handle was already linked in.
- */
-#define CALLWHEEL_CHECK(c)						      \
-	if (callwheel_initialized) {					      \
-		int callwheel_iter;					      \
-		struct callout *c_iter;					      \
-									      \
-		mtx_lock_spin(&callout_lock);				      \
-		for (callwheel_iter = 0; callwheel_iter <= callwheelmask;     \
-		    callwheel_iter++)					      \
-			TAILQ_FOREACH(c_iter, &callwheel[callwheel_iter],     \
-			    c_links.tqe)				      \
-				if (c_iter == c)			      \
-					panic("%s() for active handle!",      \
-					    __FUNCTION__);		      \
-		mtx_unlock_spin(&callout_lock);				      \
-	}
-#else
-#define CALLWHEEL_CHECK(c)
-#endif /* INVARIANTS */
 
 void
 callout_init(c, mpsafe)
 	struct	callout *c;
 	int mpsafe;
 {
-	CALLWHEEL_CHECK(c);
 	bzero(c, sizeof *c);
 	if (mpsafe) {
 		c->c_lock = NULL;
@@ -799,7 +770,6 @@
 	struct	lock_object *lock;
 	int flags;
 {
-	CALLWHEEL_CHECK(c);
 	bzero(c, sizeof *c);
 	c->c_lock = lock;
 	KASSERT((flags & ~(CALLOUT_RETURNUNLOCKED | CALLOUT_SHAREDLOCK)) == 0,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200805150100.m4F10LvE078787>