Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Apr 2001 15:04:46 -0700 (PDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Jeff Fellin <jkf@research.bell-labs.com>
Cc:        freebsd-smp@FreeBSD.org, freebsd-arch@FreeBSD.org
Subject:   RE: Making a driver SMP-safe
Message-ID:  <XFMail.010411150446.jhb@FreeBSD.org>
In-Reply-To: <200104112140.RAA14852@aura.research.bell-labs.com>

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

On 11-Apr-01 Jeff Fellin wrote:
> 
> I'm not sure this belongs here or in bsd-smp, so I'm dual posting it.
> 
> I have a question on what the actual interfaces, and if there are
> any guidelines on how to convert a device driver that runs in a
> UniProcessor environement to one that can run on concurrent CPU's
> in a MultiProcessor environment.
> 
> Many of the archives talk about mutexes in general, but I haven't
> seen a concise description of how a driver needs to deal with SMP
> issues. I have written several SMP drivers using the POSIX and other
> SMP mutex schemes, so I need to know the API's.
> 
> 
> I have built my driver on an SMP kernel (STABLE) and it works,
> at least to funky lock panics. So, I assume something was done to
> prevent concurrent access to my driver in STABLE. I would like to 
> know what was done to protect the driver from executing concurrently.

In stable there is a giant spin lock around the entire kernel, which protects
your driver.  In -current it's a bit different, but at this point in time it
all looks the same to the drivers as there is a Giant mutex that protects 99%
of the kernel still.  Later on when Giant is split up driver's will start
needing to use locks to protect their data as well as to access shared data.

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

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?XFMail.010411150446.jhb>