Re: RT-Linux and SMP

Victor Yodaiken (yodaiken@chelm.cs.nmt.edu)
Thu, 24 Apr 1997 11:56:02 -0600


On Apr 24, 10:44am, Linus Torvalds wrote:
Subject: Re: RT-Linux and SMP
>
>
>On Thu, 24 Apr 1997, Victor Yodaiken wrote:
>>
>> Sure. But you are permitting two interrupts to execute at the same time
>> as long as neither invokes cli. So what prevents those two routines from
>> modifying each others data? If interrupt routines executing in non-cli
>> mode can modify shared data, wouldn't this cause a problem for SMP and
>> even in the single processor case?
>
>Two interrupts can run at the same time even under UP ("same time" in a
>very limited sense, obviously - but one interrupt can interrupt the
>other). As such, if we are ever in a critical section where this makes a
>difference, that critical section obviously has to do a cli/sti.
>
>And they do.

Of course. I'm obviously not making my question sufficiently clear.
What you seem to be telling me is that some IRQ code modifies critical
data outside of a cli/sti pair. If this were not true, then simply
making sure that at most one processor was within a cli/sti pair
would suffice.

On a related issue. In this SMP design, it looks like cli has no
effect at all on non-irq kernel mode. That is, if one processor
does a cli while in a system call, nothing prevents a second processor
from also doing a cli and entering the same code. Did I miss something?

>
>> In any event, I think that the rtlinux soft-interrupts fits into this
>> scheme quite well and should make the irq_lock unecessary.
>
>I don't believe you can make the irq_lock unnecessary - _something_ like
>that is needed anyway.

Something like it is needed anyway by rtlinux. But the soft-interrupt
lock will prevent non-rt code from getting as far as enter_irq.
We'll see when the code is written.