From owner-freebsd-current Sun Mar 26 9:53:34 2000 Delivered-To: freebsd-current@freebsd.org Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by hub.freebsd.org (Postfix) with ESMTP id BDB2C37BA96 for ; Sun, 26 Mar 2000 09:53:27 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.9.3/8.9.1) id JAA32428; Sun, 26 Mar 2000 09:53:21 -0800 (PST) (envelope-from dillon) Date: Sun, 26 Mar 2000 09:53:21 -0800 (PST) From: Matthew Dillon Message-Id: <200003261753.JAA32428@apollo.backplane.com> To: Doug Rabson Cc: Alfred Perlstein , freebsd-current@FreeBSD.ORG Subject: Re: SMP/BGL patch 04 References: Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG :I haven't looked at the patch so I can't comment on it (but it sounds very :promising). : :I have been writing some of the infrastructure for SMP on alpha and as an :experiment I've been using the mutex_t primitive from BSD/OS as an :experiment. This is a nice simple api for a counting mutex which BSD/OS :4.1 uses for its BGL. I have not yet seen the new BSD/OS smp code but it :seemed that using mutex_t might make it marginally easier to work with :that. : :-- :Doug Rabson Mail: dfr@nlsystems.com :Nonlinear Systems Ltd. Phone: +44 181 442 9037 Our BGL is essentially the same thing - a counting mutex with no special attributes (for example, it doesn't get fancy with cli/sti). I did a commit in Nov 99 which optimized the recursion case. It may not have been apparent from reading the code due to all the nasty CPU locking stuff that was in there (and now removed in my patchset). In FreeBSD we have two other sorts of SMP related locks: s_lock, and ss_lock. s_lock is a simple spinlock, ss_lock is a spinlock which disables interrupts. ss_lock is really crufty. The word 'bad' doesn't even begin to describe it. It is not recursive or nestable. It also will not apply at all when we move to interrupt threads. I've been removing ss_lock use in my SMP patch right and left and I'll probably remove the ss_lock code itself in patch-08. -Matt Matthew Dillon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message