From owner-p4-projects@FreeBSD.ORG Wed May 7 20:50:44 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9571E1065676; Wed, 7 May 2008 20:50:44 +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 56E62106567B for ; Wed, 7 May 2008 20:50:44 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 47B978FC20 for ; Wed, 7 May 2008 20:50:44 +0000 (UTC) (envelope-from jhb@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 m47KohYB070614 for ; Wed, 7 May 2008 20:50:43 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m47KohOo070612 for perforce@freebsd.org; Wed, 7 May 2008 20:50:43 GMT (envelope-from jhb@freebsd.org) Date: Wed, 7 May 2008 20:50:43 GMT Message-Id: <200805072050.m47KohOo070612@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Cc: Subject: PERFORCE change 141298 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: Wed, 07 May 2008 20:50:45 -0000 http://perforce.freebsd.org/chv.cgi?CH=141298 Change 141298 by jhb@jhb_mutex on 2008/05/07 20:50:43 Catch up to per-cpu callout wheels. Affected files ... .. //depot/projects/smpng/sys/kern/kern_timeout.c#39 edit Differences ... ==== //depot/projects/smpng/sys/kern/kern_timeout.c#39 (text+ko) ==== @@ -884,29 +884,42 @@ DB_SHOW_COMMAND(callouts, db_show_callouts) { + struct callout_cpu *cc; struct callout *c; int bucket, callouts, sticks; +#ifdef SMP + if (have_addr) { + if (addr >= 0 && addr <= mp_maxid && !CPU_ABSENT(addr)) + cc = CC_CPU(addr); + else { + db_printf("Invalid cpu %d\n", addr); + return; + } + } else +#endif + cc = CC_SELF(); + /* First, count the number of callouts. */ callouts = 0; for (bucket = 0; bucket < callwheelsize; bucket++) { - TAILQ_FOREACH(c, &callwheel[bucket], c_links.tqe) { + TAILQ_FOREACH(c, &cc->cc_callwheel[bucket], c_links.tqe) { callouts++; } } - sticks = softticks; + sticks = cc->cc_softticks; do { bucket = sticks & callwheelmask; - TAILQ_FOREACH(c, &callwheel[bucket], c_links.tqe) { + TAILQ_FOREACH(c, &cc->cc_callwheel[bucket], c_links.tqe) { if (c->c_time < sticks) continue; if (c->c_time > sticks) break; #if 1 - db_printf("%9d ", c->c_time - softticks); + db_printf("%9d ", c->c_time - cc->cc_softticks); #else - db_print_ticks(c->c_time - softticks); + db_print_ticks(c->c_time - cc->cc_softticks); db_printf(" "); #endif db_printsym((db_expr_t)c->c_func, DB_STGY_PROC);