Re: TSCs are a no-no on i386

From: Jamie Lokier (jamie@shareable.org)
Date: Thu Jul 31 2003 - 10:07:58 EST


Willy Tarreau wrote:
> The other problem lies with the lock :
> When a 486 executes "LOCK ; CMPXCHG", it locks the bus during the whole cmpxchg
> instruction. If a 386 executes the same code, it will get an exception which
> will be caught by the emulator. I don't see how we can do such an atomic
> operation while holding a lock. At best, we would think about a global memory
> based shared lock during the operation (eg: int bus_lock;), but it's not
> implemented at the moment, and will only be compatible with processors sharing
> the same code. Add-on processors, such as co-processors, transputer cards, or
> DSPs, will know nothing about such a lock emulation. And it would result in
> even poorer performance of course !

Of course this is not a problem when "lock;cmpxchg" is used only for thread
synchronisation on uniprocessor 386s... The lock prefix is irrelevant then.

Perhaps the emulation should refuse to pretend to work on an SMP 386 :)

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



This archive was generated by hypermail 2b29 : Thu Jul 31 2003 - 22:00:50 EST