Re: splimp()

From: Robert Watson <rwatson_at_FreeBSD.org>
Date: Sun, 24 Feb 2008 11:11:04 +0000 (GMT)
On Sun, 24 Feb 2008, Kris Kennaway wrote:

> Barney Cordoba wrote:
>> I'm porting some older software to 7.0 and I see that many of the 7.0 
>> drivers use both locks and splimps() to protect code, particularly the 
>> firewire driver. What cases would an splimp() be required?
>
> spl*() are NOPs that are only left behind in some code as a reminder of what 
> mutual exclusion protections used to apply, mostly in cases where there has 
> not been fine-grained locking applied to the code in question.  In some 
> (most?) cases they serve no useful annotation purpose and should just be 
> removed.  For newly written code they should be added.

I'm pretty sure you meant "should not be added" :-).

There are places in the tree where spl*() references persist due to inadequate 
synchronization, in which case they should be left in order to continue to 
provide an annoying reminder of that requirement.  Ideally, files that 
retrained spl's would increasingly be annotated with comments indicating why 
they remain.

The other argument for retaining spl's was to make maintaining a single 
driver/whatever source across FreeBSD 4.x and forwards; this is presumably 
also decreasingly a requirement over time.

Robert N M Watson
Computer Laboratory
University of Cambridge
Received on Sun Feb 24 2008 - 10:11:05 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:28 UTC