From owner-freebsd-arch Thu Mar 22 23:26: 3 2001 Delivered-To: freebsd-arch@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 8917737B718; Thu, 22 Mar 2001 23:25:59 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id SAA12815; Fri, 23 Mar 2001 18:25:56 +1100 Date: Fri, 23 Mar 2001 18:25:09 +1100 (EST) From: Bruce Evans X-Sender: bde@besplex.bde.org To: John Baldwin Cc: Matthew Jacob , arch@FreeBSD.ORG Subject: Re: Critical Regions Round II In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, 22 Mar 2001, John Baldwin wrote: > On 22-Mar-01 Matthew Jacob wrote: > > What's wrong with alpha having > > > > disable_intr() calls MD/platform function that disables mainbridge > ints > > enable_intr() calls MD/platform function that enables mainbridge ints 1. Someone might use them in MI code if they have generic names like that. 2. The MD versions might be a little different from the MI versions and from each other, so they should have different names. > That's fine, however, with this change, disable/enable_intr() are actually > called in very few places. Mostly in trap() on x86 due to hacks to work around > Cyrix bugs, and in configure(). Everything else uses critical_*. > > Well, the joy driver needs fixing (it should use critical_*) as does the bktr > driver. The x86 pcvt driver is also obnoxious, but its x86 specific, and the > pc98 spkr and dma drivers should be using critical_* so that they work in a > nested fashion. Most of these drivers show how not to use disable_intr(). I think most of them should have used splhigh(). The translation of splhigh() to SMPng is mtx_lock*() plus maybe giving the driver a realtime priority, not critical_enter(). > Hmm, and x86 profiling, though again, that can use critical_*. > Kernel x86 profiling with SMP is broken in lots of interesting ways. Profiling for all arches currently needs to use something both more and less than critical_*: - more, because the profiling state is shared between all CPUs. I guess disabling interrupts will be sufficient when profiling works properly under SMP. I don't see how call graphs can work if calls for all CPUs are recorded in the same profiling state. - less, because critical_* should be subject to profiling, so it can't be called from profiling code. Profiling can easily use MD interfaces for locking since what it uses is defined by the MD macros MCOUNT_DECL(), MCOUNT_ENTER() and MCOUNT_EXIT(). Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message