From owner-freebsd-smp Thu Dec 5 09:24:22 1996 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id JAA19515 for smp-outgoing; Thu, 5 Dec 1996 09:24:22 -0800 (PST) Received: from clem.systemsix.com (clem.systemsix.com [198.99.86.131]) by freefall.freebsd.org (8.8.4/8.8.4) with SMTP id JAA19508 for ; Thu, 5 Dec 1996 09:24:17 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by clem.systemsix.com (8.6.12/8.6.12) with SMTP id KAA13519; Thu, 5 Dec 1996 10:23:56 -0700 Message-Id: <199612051723.KAA13519@clem.systemsix.com> X-Authentication-Warning: clem.systemsix.com: Host localhost didn't use HELO protocol X-Mailer: exmh version 1.6.5 12/11/95 From: Steve Passe To: Chris Csanady cc: Peter Wemm , smp@freebsd.org Subject: Re: make locking more generic? In-reply-to: Your message of "Thu, 05 Dec 1996 08:46:59 CST." <199612051447.IAA04684@friley216.res.iastate.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 05 Dec 1996 10:23:56 -0700 Sender: owner-smp@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Hi, > ... >I wasn't referring to a fine grained implementation right off hand. Just >a couple more locks, and it would be quite difficult to get into a deadlock >situation with them. Even so, you could still call it giant locking.. :P another issue related to the current "giant lock" scheme is INT steering. The APICs use a 'Task Priority Register' and 'Process Priority Register' to determine which CPU gets IRQs from the IO APIC. Basically, the CPU running at the LOWEST priority gets sent any pending IRQs. The problem with the "giant lock" is that when a CPU holds it, no other CPU can service an INT since it spins on the lock. So whenever a CPU acquires the lock I have the code set the priority of that CPU to "VERY LOW". So now all pending INTs will be sent to it, which it can deal with since it already holds the lock. When a CPU releaes the lock it resets its priority to "NORMAL". The problem is that whenever a CPU gets an INT its PPR is increased to the priority of the INT, thus negating the "VERY LOW" prio I set in the TPR. So if a CPU is behind the lock because of an INT it WON'T get sent other pending INTs, the other CPU will. Now that we have IPIs working I hope to be able to send an IPI to the other CPUs telling them to set their TPR to "VERY HIGH", thus dis-abling them from getting INTs. After reading the last paragraph you might wonder why I even bother setting the CPU TPR to "VERY LOW", its because it is still beneficial for all other cases where the CPU holds the lock, syscalls, etc. In these cases the CPU PPR is not set by a pending INT and the TPR is the sole arbitor of the INT steerage. Anyways, the bottom line is that finer grain locking has to consider this INT streerage situation as well as the million other details involved! -- Steve Passe | powered by smp@csn.net | FreeBSD