Re: [patch] SMP race fix [was Re: SMP lockup & 3c509 on 2.2.x [aka. the Deadly 'ping -f']]

Raul Miller (rdm@test.legislate.com)
Thu, 6 May 1999 10:31:34 -0400


Linus Torvalds <torvalds@transmeta.com> wrote:
> Yes. But the problem then becomes one of common code. It may make sense to
> have code that wants to atomically make sure that it's running on only the
> current CPU and that is called from different contexts (both irq and not),
> and it just does a
>
> disable_irq(myirq);
> .. do some slow stuff ..
> enable_irq(myirq);
>
> and the dangerous thing is that it would work on UP, but mysteriously (and
> nonobviously) lock up on SMP with your implementation.

Hmm, a couple stupid questions: [If we went with Andrea's approach]

(1) For the case of common code, shouldn't the wrapper be migrate out into
the non-common region?

(2) Couldn't something be done to >occasionally< detect this potential lockup,
and occasionally issue warnings? [So, yeah, it will lock up, but somebody is
gonna see the warnings.]

-- 
Raul

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/