Skip to contentSkip to conversation

386/smp issue with atomic_add_return()

DISCUSSION lepton 2 participants 2 messages Apr 12, 2006

lore
Share & tools
lore

lepton

author
#0 lore raw

Hi
Is there any smp box with 386 cpu?
If it exist, then I think atomic_add_return has a problem.
Just disabling local interrupts can not keep another cpu from entering this function. What do you think about this?

This is the code (copied from 2.6.16.4):

#ifdef CONFIG_M386
no_xadd: /* Legacy 386 processor */

        local_irq_disable();
        __i = atomic_read(v);
        atomic_set(v, i + __i);
        local_irq_enable();
        return i + __i;
	#endif
#1 lore raw
Quoted 8 lines · lepton

Hi
Is there any smp box with 386 cpu?
If it exist, then I think atomic_add_return has a problem.
Just disabling local interrupts can not keep another cpu from entering this function. What do you think about this?

This is the code (copied from 2.6.16.4):

Quoted 8 lines

#ifdef CONFIG_M386
no_xadd: /* Legacy 386 processor */

        local_irq_disable();
        __i = atomic_read(v);
        atomic_set(v, i + __i);
        local_irq_enable();
        return i + __i;
        #endif

If such a box exists (and I doubt), it is not a commody PC. First x86 SMP motherboard I heard of was a P1 with two processors.