[lkml]   [1999]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: 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.

    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
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:55    [W:0.021 / U:5.964 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site