From owner-freebsd-threads@FreeBSD.ORG Tue Sep 14 08:24:36 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BBCDC16A4CE; Tue, 14 Sep 2004 08:24:36 +0000 (GMT) Received: from pimout3-ext.prodigy.net (pimout3-ext.prodigy.net [207.115.63.102]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B45C43D1D; Tue, 14 Sep 2004 08:24:36 +0000 (GMT) (envelope-from julian@elischer.org) Received: from elischer.org (adsl-67-126-115-227.dsl.snfc21.pacbell.net [67.126.115.227])i8E8OXPJ138314; Tue, 14 Sep 2004 04:24:34 -0400 Message-ID: <4146AAC1.5020701@elischer.org> Date: Tue, 14 Sep 2004 01:24:33 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4b) Gecko/20030524 X-Accept-Language: en, hu MIME-Version: 1.0 To: Andrew Gallatin References: <16703.11479.679335.588170@grasshopper.cs.duke.edu> <16703.12410.319869.29996@grasshopper.cs.duke.edu> <413F55B8.50003@elischer.org> <16703.28031.454342.774229@grasshopper.cs.duke.edu> <413F8DBB.5040502@elischer.org> <16704.40876.708925.425911@grasshopper.cs.duke.edu> <4140AA2A.90605@elischer.org> <16704.45327.42494.922427@grasshopper.cs.duke.edu> <4140C04D.1060906@elischer.org> <16704.49447.290897.602540@grasshopper.cs.duke.edu> In-Reply-To: <16704.49447.290897.602540@grasshopper.cs.duke.edu> Content-Type: multipart/mixed; boundary="------------080701070602030008080208" cc: John Baldwin cc: freebsd-threads@freebsd.org Subject: Re: Unkillable KSE threaded proc X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2004 08:24:36 -0000 This is a multi-part message in MIME format. --------------080701070602030008080208 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Andrew Gallatin wrote: > Julian Elischer writes: > > > > > >Maybe this would be easier to debug if I disabled preemption? > > > > > > > > > I think that this would possibly GO AWAY of you disab;ed preemption. > > which would make it very hard to debug :-) > > > > Yes and no. You initially asked me to try in -current because of > some changes you'd made to the exit code. RELENG_5 (with the old > exit code and no preemption) shows a different problem (proc is > just not killable). If the proc was killable without preemption, > that would at least show your new code is better.. try the attached diff: > > Drew --------------080701070602030008080208 Content-Type: text/plain; name="q.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="q.diff" Index: sys/kern/kern_switch.c =========================================================================== --- sys/kern/kern_switch.c 2004/09/14 08:14:48 #76 +++ sys/kern/kern_switch.c 2004/09/14 08:14:48 @@ -350,11 +389,10 @@ } kg->kg_avail_opennings = 1; } - kg->kg_avail_opennings--; sched_add(td, flags); return; } tda = kg->kg_last_assigned; if ((kg->kg_avail_opennings <= 0) && (tda && (tda->td_priority > td->td_priority))) { @@ -415,7 +449,6 @@ td2 = TAILQ_NEXT(tda, td_runq); kg->kg_last_assigned = td2; } - kg->kg_avail_opennings--; sched_add(td2, flags); } else { CTR3(KTR_RUNQ, "setrunqueue: held: td%p kg%p pid%d", Index: sys/kern/sched_4bsd.c =========================================================================== --- sys/kern/sched_4bsd.c 2004/09/14 08:14:48 #64 +++ sys/kern/sched_4bsd.c 2004/09/14 08:14:48 @@ -1024,6 +1024,7 @@ } if ((td->td_proc->p_flag & P_NOLOAD) == 0) sched_tdcnt++; + td->td_ksegrp->kg_avail_opennings--; runq_add(ke->ke_runq, ke); ke->ke_ksegrp->kg_runq_kses++; ke->ke_state = KES_ONRUNQ; Index: sys/kern/sched_ule.c =========================================================================== --- sys/kern/sched_ule.c 2004/09/14 08:14:48 #127 +++ sys/kern/sched_ule.c 2004/09/14 08:14:48 @@ -1773,6 +1773,7 @@ curthread->td_flags |= TDF_NEEDRESCHED; if (preemptive && maybe_preempt(td)) return; + td->td_ksegrp->kg_avail_opennings--; ke->ke_ksegrp->kg_runq_threads++; ke->ke_state = KES_ONRUNQ; --------------080701070602030008080208--