Re: module programming smp-safety howto?

From: Erik Mouw (J.A.K.Mouw@its.tudelft.nl)
Date: Wed Apr 10 2002 - 05:49:56 EST


On Wed, Apr 10, 2002 at 12:03:23PM +0200, Emmanuel Michon wrote:
> I'm responsible for the development of a kernel module for Sigma
> Designs EM84xx PCI chips (MPEG2 and MPEG4 hardware decoder
> boards). It's working properly now, irq sharing and multiple board
> support is ok.
>
> I would like to make it smp-safe.
>
> For instance, I use at a place cli()/restore to implement something that
> looks like a critical section (first code path is in a ioctl, second
> in a irq top half). I guess this approach is wrong with smp.
>
> Is there some documentation or howto about what changes compared
> to non-smp computers?

Run "make psdocs" in your kernel tree, and you'll find Rusty's
kernel-locking guide in Documentation/DocBook/ . If you don't have the
proper tools, you can also download it from
http://www.kernelnewbies.org/documents/ .

> Maybe a specific kernel module can be considered as a good model?

I found the 8139too driver a nice source for good programming practice
(thanks, Jeff!).

Erik

-- 
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Faculty
of Information Technology and Systems, Delft University of Technology,
PO BOX 5031, 2600 GA Delft, The Netherlands  Phone: +31-15-2783635
Fax: +31-15-2781843  Email: J.A.K.Mouw@its.tudelft.nl
WWW: http://www-ict.its.tudelft.nl/~erik/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Apr 15 2002 - 22:00:15 EST