Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Mar 2001 18:25:09 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        John Baldwin <jhb@FreeBSD.ORG>
Cc:        Matthew Jacob <mjacob@feral.com>, arch@FreeBSD.ORG
Subject:   Re: Critical Regions Round II
Message-ID:  <Pine.BSF.4.21.0103231817520.17960-100000@besplex.bde.org>
In-Reply-To: <XFMail.010322153200.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0103231817520.17960-100000>