Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Aug 1997 16:44:38 -0600
From:      Steve Passe <smp@csn.net>
To:        Terry Lambert <terry@lambert.org>
Cc:        petrilli@amber.org, mestery@winternet.com, peters@gil.com.au, smp@FreeBSD.ORG
Subject:   Re: A how does it work question. 
Message-ID:  <199708272244.QAA00398@Ilsa.StevesCafe.com>
In-Reply-To: Your message of "Wed, 27 Aug 1997 14:59:04 PDT." <199708272159.OAA00591@phaeton.artisoft.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

> > thats already planned.  sio.c and cy.c are already MP-safe from the kernel's
> > point of view.  The problem is that they are not 'concurrancy-safe', ie
> > they never expected to be run concurrently by more than 1 CPU.  This
> > sort of problem is not so well demonstrated with an example driver, as the
> > specific issues will vary from driver to driver.
> 
> I don't think I understand the distinction.  If by "the are already
> MP safe" you mean "because of the lock", that's not a flaggable
> attribute.

no, I mean they are MP-safe because I went thru them and added simple-locks
around all the regions that are shared by both the ISR and the top half
of the kernel.  The outer lock in the FAST_INTR() macro is strictly to keep the
ISR from being run concurrently, eg CPU0 for an INT on tty0 and CPU1 for an
INT on tty1.  There are global variables in sio.c that would fail if used
concurrantly.

---
> The flag I'm talking about is a "this driver may be reentered" flag;
> are you saying it's possible to reenter it on the same CPU, but not
> on a different CPU?  That' might be one issue, but I don't think
> that would qualify for the MPSAFE flag...

no, there should be no distinction as to CPU, but you obviously can't
reenter a fast interrupt from the same CPU, as fast ISRs run to completion, ie
they can't be interrupted by themselves.  But they could interrupt another
CPU which would then attempt to enter the same ISR without the OUTER lock
in place to prevent it.

--
Steve Passe	| powered by
smp@csn.net	|            Symmetric MultiProcessor FreeBSD





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199708272244.QAA00398>