From owner-p4-projects@FreeBSD.ORG Sat Mar 11 01:15:57 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B848E16A42D; Sat, 11 Mar 2006 01:15:53 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CE69916A423 for ; Sat, 11 Mar 2006 01:15:52 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B00944531B for ; Fri, 10 Mar 2006 14:07:49 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k2AE7ioD002719 for ; Fri, 10 Mar 2006 14:07:44 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k2AE7d87002700 for perforce@freebsd.org; Fri, 10 Mar 2006 14:07:39 GMT (envelope-from jhb@freebsd.org) Date: Fri, 10 Mar 2006 14:07:39 GMT Message-Id: <200603101407.k2AE7d87002700@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 93109 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: Sat, 11 Mar 2006 01:15:57 -0000 http://perforce.freebsd.org/chv.cgi?CH=93109 Change 93109 by jhb@jhb_slimer on 2006/03/10 14:06:37 Do the kdb check earlier in mi_switch() to avoid doublecounting rux_runtime. Affected files ... .. //depot/projects/smpng/sys/kern/kern_synch.c#99 edit Differences ... ==== //depot/projects/smpng/sys/kern/kern_synch.c#99 (text+ko) ==== @@ -355,6 +355,16 @@ ("mi_switch: switch must be voluntary or involuntary")); KASSERT(newtd != curthread, ("mi_switch: preempting back to ourself")); + /* + * Don't perform context switches from the debugger. + */ + if (kdb_active) { + mtx_unlock_spin(&sched_lock); + kdb_backtrace(); + kdb_reenter(); + panic("%s: did not reenter debugger", __func__); + } + if (flags & SW_VOL) p->p_stats->p_ru.ru_nvcsw++; else @@ -376,16 +386,6 @@ td->td_generation++; /* bump preempt-detect counter */ /* - * Don't perform context switches from the debugger. - */ - if (kdb_active) { - mtx_unlock_spin(&sched_lock); - kdb_backtrace(); - kdb_reenter(); - panic("%s: did not reenter debugger", __func__); - } - - /* * Check if the process exceeds its cpu resource allocation. If * it reaches the max, arrange to kill the process in ast(). */