lkml.org 
[lkml]   [1998]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PARPORT] [patch] lp needed testers [Re: lp fix against pre-2.1.127-7]

On Sat, 7 Nov 1998, Andrea Arcangeli wrote:

> /*
> * Force strict CPU ordering.
> * And yes, this is required on UP too when we're talking
> * to devices.
> */
> #define mb() __asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory")
>

> I also remeber this issue on linux-kernel some time ago (when Linus
> suggested people to use cpuid to implement mb(), but maybe I have
> understood things wrong...).

no thats correct. The above implementation was found (and benchmarked) to
be the most cache-friendly serializing+synchronizing instruction: 0(%esp)
is very likely in the L1/L2 cache, and is local to the executing process
so it's not in any other system cache, plus it does not clobber any
registers. (unlike CPUID which clobbers a handful or generic registers)

-- mingo


-
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/

\
 
 \ /
  Last update: 2005-03-22 13:45    [W:0.048 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site