virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] x86: faster mb()+other barrier.h tweaks
@ 2016-01-12 22:10 Michael S. Tsirkin
  2016-01-12 22:10 ` [PATCH v2 1/3] x86: drop mfence in favor of lock+addl Michael S. Tsirkin
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Michael S. Tsirkin @ 2016-01-12 22:10 UTC (permalink / raw)
  To: linux-kernel, Linus Torvalds
  Cc: Davidlohr Bueso, Davidlohr Bueso, Peter Zijlstra,
	the arch/x86 maintainers, virtualization, H. Peter Anvin,
	Thomas Gleixner, Paul E. McKenney, Ingo Molnar

mb() typically uses mfence on modern x86, but a micro-benchmark shows that it's
2 to 3 times slower than lock; addl $0,(%%e/rsp) that we use on older CPUs.

So let's use the locked variant everywhere - helps keep the code simple as
well.

While I was at it, I found some inconsistencies in comments in
arch/x86/include/asm/barrier.h

I hope I'm not splitting this up too much - the reason is I wanted to isolate
the code changes (that people might want to test for performance) from comment
changes approved by Linus, from (so far unreviewed) comment change I came up
with myself.

Lightly tested on my system.

Michael S. Tsirkin (3):
  x86: drop mfence in favor of lock+addl
  x86: drop a comment left over from X86_OOSTORE
  x86: tweak the comment about use of wmb for IO

 arch/x86/include/asm/barrier.h | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

-- 
MST

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-10-11 18:11 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-12 22:10 [PATCH v2 0/3] x86: faster mb()+other barrier.h tweaks Michael S. Tsirkin
2016-01-12 22:10 ` [PATCH v2 1/3] x86: drop mfence in favor of lock+addl Michael S. Tsirkin
2016-01-12 22:10 ` [PATCH v2 2/3] x86: drop a comment left over from X86_OOSTORE Michael S. Tsirkin
2016-01-12 22:25   ` One Thousand Gnomes
2016-01-12 22:10 ` [PATCH v2 3/3] x86: tweak the comment about use of wmb for IO Michael S. Tsirkin
2016-01-12 22:25 ` [PATCH v2 0/3] x86: faster mb()+other barrier.h tweaks H. Peter Anvin
2016-01-26  8:20   ` Michael S. Tsirkin
2016-01-26 21:37     ` H. Peter Anvin
2016-01-27 14:07       ` Michael S. Tsirkin
2016-01-27 14:14         ` Peter Zijlstra
2016-01-27 14:18           ` Michael S. Tsirkin
     [not found]     ` <20181011173707.26pekp65tlipvhdx@alap3.anarazel.de>
2018-10-11 18:11       ` Michael S. Tsirkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).