Re: LFENCE instruction (was: [rfc][patch 3/3] x86: optimise barriers)

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Mikulas Patocka <mikulas@...>
Cc: Arjan van de Ven <arjan@...>, Linux Kernel Mailing List <linux-kernel@...>
Date: Tuesday, October 16, 2007 - 7:21 pm

On Wed, Oct 17, 2007 at 01:05:16AM +0200, Mikulas Patocka wrote:

What do you mean "already"? If we already have drivers loading data from
WC memory, then rmb() needs to order them, whether or not they actually
need it. If that were prohibitively costly, then we'd introduce a new
barrier which does not order WC memory, right?



You mean the one defined like this:
  #define wmb()   asm volatile("sfence" ::: "memory")
? If it assumed writes are ordered, then it would just be a barrier().



Most tend to order them strongly these days. There are also relaxed
variants for architectures that can take advantage of them.



I don't understand why you say wmb() doesn't work on WC memory. What part
of which spec are you reading (or, given your mistrust of specs, what CPU
are you seeing failures with)?
 


Well it clearly is the case because I just pointed you to a document
that says they can go out of order. If you want to argue that existing
implementations do not, then by all means go ahead and send a patch to
Linus and see what he says about it ;)

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: LFENCE instruction (was: [rfc][patch 3/3] x86: optimise ..., Nick Piggin, (Tue Oct 16, 7:21 pm)
Re: LFENCE instruction, H. Peter Anvin, (Tue Oct 16, 11:42 am)
Re: LFENCE instruction, Mikulas Patocka, (Tue Oct 16, 5:25 pm)