From owner-p4-projects@FreeBSD.ORG Thu May 15 01:00:22 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CF20410656C8; Thu, 15 May 2008 01:00:21 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9133F10656C4 for ; Thu, 15 May 2008 01:00:21 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 8564A8FC18 for ; Thu, 15 May 2008 01:00:21 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m4F10Ltd078789 for ; Thu, 15 May 2008 01:00:21 GMT (envelope-from julian@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m4F10LvE078787 for perforce@freebsd.org; Thu, 15 May 2008 01:00:21 GMT (envelope-from julian@freebsd.org) Date: Thu, 15 May 2008 01:00:21 GMT Message-Id: <200805150100.m4F10LvE078787@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to julian@freebsd.org using -f From: Julian Elischer To: Perforce Change Reviews Cc: Subject: PERFORCE change 141617 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2008 01:00:22 -0000 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,