From owner-p4-projects@FreeBSD.ORG Thu Jul 6 18:30:07 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 367BC16A4DF; Thu, 6 Jul 2006 18:30:07 +0000 (UTC) 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 139C816A4DA for ; Thu, 6 Jul 2006 18:30:07 +0000 (UTC) (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 A882143D53 for ; Thu, 6 Jul 2006 18:30:06 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k66IU6O6017168 for ; Thu, 6 Jul 2006 18:30:06 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k66IU6ML017165 for perforce@freebsd.org; Thu, 6 Jul 2006 18:30:06 GMT (envelope-from jhb@freebsd.org) Date: Thu, 6 Jul 2006 18:30:06 GMT Message-Id: <200607061830.k66IU6ML017165@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 100784 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, 06 Jul 2006 18:30:07 -0000 http://perforce.freebsd.org/chv.cgi?CH=100784 Change 100784 by jhb@jhb_mutex on 2006/07/06 18:29:47 Revert this change. It ends up tripping a panic because in the case of an "extra" thread exiting td_ksegrp will be NULL when we do PROC_UNLOCK(). If the proc mtx is contested and this thread has a regular user priority for it's base priority, then in sched_unlend_prio() when we go to fetch the most recent user priority from the ksegroup we panic. Affected files ... .. //depot/projects/smpng/sys/kern/kern_thread.c#91 edit Differences ... ==== //depot/projects/smpng/sys/kern/kern_thread.c#91 (text+ko) ==== @@ -579,6 +579,7 @@ ksegrp_unlink(kg); ksegrp_stash(kg); } + PROC_UNLOCK(p); td->td_ksegrp = NULL; PCPU_SET(deadthread, td); } else { @@ -601,9 +602,9 @@ * This includes an EX threaded process that is coming * here via exit1(). (exit1 dethreads the proc first). */ + PROC_UNLOCK(p); } - PROC_UNLOCK(p); td->td_state = TDS_INACTIVE; CTR1(KTR_PROC, "thread_exit: cpu_throw() thread %p", td); cpu_throw(td, choosethread());