Messages in this thread | | | Date | Sat, 20 Nov 1999 20:49:36 -0500 (EST) | From | "Richard B. Johnson" <> | Subject | Re: spin_unlock optimization(i386) |
| |
On Sat, 20 Nov 1999, Manfred Spraul wrote:
> the current spin_unlock asm code is > "lock; btrl $0,%0" > it takes ~ 22 ticks on my PII/350. > > I think it's possible to replace that with > "movl $0,%0" > which would be a simple, pairable single-tick instruction.
Erm.... What about SMP machines? Are you going to get rid of them? The purpose of the lock prefix is not to make the current CPU operation atomic. It's to make all other CPUs halt until the operation is complete. This gurantees that only one CPU modifies the variable at the same time. You are not going to do that with a move.
Cheers, Dick Johnson
Penguin : Linux version 2.3.13 on an i686 machine (400.59 BogoMips). Warning : It's hard to remain at the trailing edge of technology.
- 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/
| |