Re: MOD_INC_USE_COUNT

Albert D. Cahalan (acahalan@cs.uml.edu)
Mon, 10 Nov 1997 22:23:04 -0500 (EST)


Bill Hawes writes:
Regis Duchesne wrote:
>
>> Context switches can occur only if the process blocks (goes to sleep).
>> Interrupts can occur in between instructions, but not context switches.
>> MOD_INC_USE_CNT only needs to worry about blocking operations.
>
> Thanks for your answer. But the interesting question now is:
> have you an exhaustive list of blocking ops?
>
> An exhaustive list, no. But every would-be race hunter needs to
> build a list of known blocking operations, even if it blocks only
> under unusual circumstances. Then when you're reviewing code
> and you see a potential block, you can look to see what operations
> might be affected.
>
> And when you discover a new blocking operation (or one that you
> hadn't realized could block), you should go back and re-review
> all the code in light of the new information.

I see why you are a good race hunter.

Many of us could use some extra help. I wonder if it would be
good to separate blocking code in another ELF section.
Then there could be a debug kernel that would check for
locks that are held... Digital Unix does something like this,
with self-modifying code to use one kernel for debug, SMP,
real-time, real-time SMP, and normal operation.

I know I can't remember all the blocking functions.