From owner-freebsd-arch@FreeBSD.ORG Sun Oct 3 23:55:17 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5434B16A4CE for ; Sun, 3 Oct 2004 23:55:17 +0000 (GMT) Received: from ylpvm43.prodigy.net (ylpvm43-ext.prodigy.net [207.115.57.74]) by mx1.FreeBSD.org (Postfix) with ESMTP id F12E443D31 for ; Sun, 3 Oct 2004 23:55:16 +0000 (GMT) (envelope-from julian@elischer.org) Received: from elischer.org (adsl-67-124-50-20.dsl.snfc21.pacbell.net [67.124.50.20])i93NtOCE007355; Sun, 3 Oct 2004 19:55:25 -0400 Message-ID: <41609162.9090502@elischer.org> Date: Sun, 03 Oct 2004 16:55:14 -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: Stephan Uphoff References: <1096489576.3733.1868.camel@palm.tree.com> <200409291652.29990.jhb@FreeBSD.org> <1096496057.3733.2163.camel@palm.tree.com> <1096603981.21577.195.camel@palm.tree.com> <1096608201.21577.203.camel@palm.tree.com> <20041001141040.GA1556@peter.osted.lan> <1096647194.27811.12.camel@palm.tree.com> <20041001192551.GA3381@peter.osted.lan> <20041002053351.GA6259@peter.osted.lan> <415EEFFE.5080309@elischer.org> <20041002183120.GA1202@peter.osted.lan> <1096760257.34527.14.camel@palm.tree.com> <415FA496.6000902@elischer.org> <1096828937.38592.52.camel@palm.tree.com> <41607192.8020809@elischer.org> <1096843419.38592.76.camel@palm.tree.com> In-Reply-To: <1096843419.38592.76.camel@palm.tree.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: Peter Holm cc: "freebsd-arch@freebsd.org" Subject: Re: scheduler (sched_4bsd) questions X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2004 23:55:17 -0000 Stephan Uphoff wrote: > On Sun, 2004-10-03 at 17:39, Julian Elischer wrote: > >>Stephan Uphoff wrote: >> you didn't answer this question.. >> >> >>> >>>>Where is the critical_enter that matches the extra critical_exit() >>>>you put in sched_switch()? I haven' been able to yet figure out how >>>>you don't get a double exit. but I've only looked for a few minutes. >>> >>==== //depot/projects/nsched/sys/kern/sched_4bsd.c#58 - >>/home/julian/p4/nsched/sys/kern/sched_4bsd.c ==== >>@@ -844,6 +844,8 @@ >> if (newtd == NULL || newtd->td_ksegrp != td->td_ksegrp) >> slot_fill(td->td_ksegrp); >> } >>+ critical_exit(); >>+ td->td_pflags &= ~TDP_OWEPREEMPT; >> } >> if (newtd) { >> /* >> >> >>where is the matching critical_enter()? interesting.. somehow when I applied that diff, the critical_enter disappeared? >> > > >>From Peter's unified diff: > > RCS file: /home/ncvs/src/sys/kern/sched_4bsd.c,v > retrieving revision 1.65 > diff -u -r1.65 sched_4bsd.c > --- sys/kern/sched_4bsd.c 16 Sep 2004 07:12:59 -0000 1.65 > +++ sys/kern/sched_4bsd.c 2 Oct 2004 14:46:29 -0000 > @@ -823,6 +823,7 @@ > TD_SET_CAN_RUN(td); > else { > td->td_ksegrp->kg_avail_opennings++; > + critical_enter(); > if (TD_IS_RUNNING(td)) { > /* Put us back on the run queue (kse and all). > */ > setrunqueue(td, SRQ_OURSELF|SRQ_YIELDING); > @@ -834,6 +835,8 @@ > */ > slot_fill(td->td_ksegrp); > } > + critical_exit(); > + td->td_pflags &= ~TDP_OWEPREEMPT; > } > if (newtd == NULL) > newtd = choosethread();