From owner-freebsd-smp Sat Sep 23 10:53:46 2000 Delivered-To: freebsd-smp@freebsd.org Received: from server.baldwin.cx (server.geekhouse.net [64.81.6.52]) by hub.freebsd.org (Postfix) with ESMTP id 8D16D37B422; Sat, 23 Sep 2000 10:53:35 -0700 (PDT) Received: from john.baldwin.cx (root@john.baldwin.cx [192.168.1.18]) by server.baldwin.cx (8.9.3/8.9.3) with ESMTP id KAA91697; Sat, 23 Sep 2000 10:55:51 -0700 (PDT) (envelope-from john@baldwin.cx) Received: (from john@localhost) by john.baldwin.cx (8.9.3/8.9.3) id KAA51845; Sat, 23 Sep 2000 10:55:12 -0700 (PDT) (envelope-from john) Message-Id: <200009231755.KAA51845@john.baldwin.cx> X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200009231727.LAA17839@berserker.bsdi.com> Date: Sat, 23 Sep 2000 10:55:12 -0700 (PDT) From: John Baldwin To: Chuck Paterson Subject: Re: Status update Cc: alpha@freebsd.org, smp@freebsd.org Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On 23-Sep-00 Chuck Paterson wrote: > > John, > } > }- software interrupts (SWI's) are now MI except for a few constants. > } Currently we still only have 8 SWI's on the x86 due to old compatability > } nonsense. We should be able to bump this to 32 like it is on the alpha very > } easily if it proves beneficial. Also software interrutps are completely > } divorced from the x86 hardware interrupt code. The softinterrupt thread is > } also now a simple kthread instead of an ithread. > > > I guess I'm a little unclear about this. We certainly don't want > any hardware goop with software interrupts, at least in the case > where there is no hardware support of software interrupts, > but it seems like we do want them to be more than just another > kthread, we want to be able to schedule them on the fly like hardware > interrupts and do light weight context switches to them. Hmm, ok. Currently the only thing we were using from the ithd structure was the it_need flag (like the runstatus flag in BSD/OS' ithreads) to know when to keep looping. I changed it to just use spending for this. It is still scheduled and ran using a method similar to the hardware ithreads, it just doesn't have a ithd struct. However, it is quite easy to add the ithd struct back in when we go to light-weight context switches. > }- The interrupt state of the sched_lock is now saved in a process's PCB during > } cpu_switch(). This way, code before and after a call to either mi_switch() > } or cpu_switch() is guaranteed to be run at the same interrupt state. Without > } this I was having problems on the alpha where the idle loop was running at > } ALPHA_PSL_IPL_SOFT (1) and as a result init's child process was never ran, > } among other things. > > > BSD/OS on Sparc actually has interrupt levels that are associated > with some mutexs. However the code that uses these levels are always > using spin locks so there isn't an issue. Whenever cpu_switch > is called all interrupts are blocked, but the spl level, which it > think is ~= interrupt state is not raised at all. On sparc these > are use for the low level code in for devices like the com driver. > > I guess the first question is why there is any kernel code calling > switch with the interrupt priority up. This sounds like it may be > a result of software interrupts being changed into kthreads? It just happens on the alpha, it doesn't happen on the x86. I'm not sure where it is happening though. If we are sure of that guarantee (interrupts should always be enabled before grabbing sched_lock and calling either cpu_switch or mi_switch) then that should make my KASSERT()'s to find this easier, and I can get rid of this code. > If alpha has hardware support for software interrupts then we might > be able to treat them fully like hardware interrupts. The case in > BSD/OS where a software interrupt is scheduled and the no switch > flag is passed in will just work, the reason for the no switch > is because the thread currently holds spins locks, which in the > case of hardware supported interrupts should be blocked anyway. Currently all SWI's are now triggered by setting the appropriate bit in spending and calling sched_softintr() to make the softinterrupt thread runnable. sched_softintr() is very similar in functionality to sched_ithd in the x86 hardware interrupt code. > Chuck -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message