login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
April
»
19
Re: [PATCH 1/5] Add a global synchronization point for pvclock
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Glauber Costa
Subject:
Re: [PATCH 1/5] Add a global synchronization point for pvclock
Date: Monday, April 19, 2010 - 7:32 am
On Mon, Apr 19, 2010 at 01:19:43PM +0200, Peter Zijlstra wrote:
quoted text
> On Mon, 2010-04-19 at 14:13 +0300, Avi Kivity wrote: > > On 04/19/2010 01:56 PM, Peter Zijlstra wrote: > > > > > > > > >>> Right, do bear in mind that the x86 implementation of atomic64_read() is > > >>> terrifyingly expensive, it is better to not do that read and simply use > > >>> the result of the cmpxchg. > > >>> > > >>> > > >>> > > >> atomic64_read() _is_ cmpxchg64b. Are you thinking of some clever > > >> implementation for smp i386? > > >> > > > > > > No, what I was suggesting was to rewrite that loop no to need the > > > initial read but use the cmpxchg result of the previous iteration. > > > > > > Something like: > > > > > > u64 last = 0; > > > > > > /* more stuff */ > > > > > > do { > > > if (ret< last) > > > return last; > > > last = cmpxchg64(&last_value, last, ret); > > > } while (last != ret); > > > > > > That only has a single cmpxchg8 in there per loop instead of two > > > (avoiding the atomic64_read() one). > > > > > > > Still have two cmpxchgs in the common case. The first iteration will > > fail, fetching last_value, the second will work. > > > > It will be better when we have contention, though, so it's worthwhile. > > Right, another option is to put the initial read outside of the loop, > that way you'll have the best of all cases, a single LOCK'ed op in the > loop, and only a single LOCK'ed op for the fast path on sensible > architectures ;-) > > last = atomic64_read(&last_value);
isn't a barrier enough here? --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH 0/5] pv clock misc fixes
, Glauber Costa
, (Thu Apr 15, 11:37 am)
[PATCH 1/5] Add a global synchronization point for pvclock
, Glauber Costa
, (Thu Apr 15, 11:37 am)
[PATCH 2/5] change msr numbers for kvmclock
, Glauber Costa
, (Thu Apr 15, 11:37 am)
[PATCH 3/5] Try using new kvm clock msrs
, Glauber Costa
, (Thu Apr 15, 11:37 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Marcelo Tosatti
, (Fri Apr 16, 1:23 pm)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Jeremy Fitzhardinge
, (Fri Apr 16, 1:36 pm)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Zachary Amsden
, (Fri Apr 16, 2:05 pm)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Avi Kivity
, (Sat Apr 17, 11:48 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Avi Kivity
, (Sat Apr 17, 11:49 am)
Re: [PATCH 2/5] change msr numbers for kvmclock
, Avi Kivity
, (Sat Apr 17, 11:51 am)
Re: [PATCH 3/5] Try using new kvm clock msrs
, Avi Kivity
, (Sat Apr 17, 11:55 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Peter Zijlstra
, (Mon Apr 19, 3:39 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Peter Zijlstra
, (Mon Apr 19, 3:43 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Peter Zijlstra
, (Mon Apr 19, 3:46 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Avi Kivity
, (Mon Apr 19, 3:47 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Avi Kivity
, (Mon Apr 19, 3:49 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Peter Zijlstra
, (Mon Apr 19, 3:49 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Peter Zijlstra
, (Mon Apr 19, 3:51 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Avi Kivity
, (Mon Apr 19, 3:53 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Avi Kivity
, (Mon Apr 19, 3:54 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Peter Zijlstra
, (Mon Apr 19, 3:56 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Peter Zijlstra
, (Mon Apr 19, 3:59 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Avi Kivity
, (Mon Apr 19, 4:10 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Avi Kivity
, (Mon Apr 19, 4:13 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Peter Zijlstra
, (Mon Apr 19, 4:19 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Avi Kivity
, (Mon Apr 19, 4:35 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Glauber Costa
, (Mon Apr 19, 7:21 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Glauber Costa
, (Mon Apr 19, 7:26 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Glauber Costa
, (Mon Apr 19, 7:32 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Avi Kivity
, (Mon Apr 19, 7:33 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Avi Kivity
, (Mon Apr 19, 7:37 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Peter Zijlstra
, (Mon Apr 19, 7:46 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Jeremy Fitzhardinge
, (Mon Apr 19, 9:11 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Jeremy Fitzhardinge
, (Mon Apr 19, 9:18 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Jeremy Fitzhardinge
, (Mon Apr 19, 9:19 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Glauber Costa
, (Mon Apr 19, 11:25 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Zachary Amsden
, (Mon Apr 19, 11:35 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Marcelo Tosatti
, (Mon Apr 19, 6:57 pm)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Avi Kivity
, (Tue Apr 20, 2:31 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Avi Kivity
, (Tue Apr 20, 2:39 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Glauber Costa
, (Tue Apr 20, 5:59 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Avi Kivity
, (Tue Apr 20, 8:16 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Jeremy Fitzhardinge
, (Tue Apr 20, 11:23 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Avi Kivity
, (Tue Apr 20, 11:54 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Jeremy Fitzhardinge
, (Tue Apr 20, 12:42 pm)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Zachary Amsden
, (Tue Apr 20, 5:01 pm)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Zachary Amsden
, (Tue Apr 20, 5:07 pm)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Avi Kivity
, (Wed Apr 21, 1:06 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Avi Kivity
, (Wed Apr 21, 1:08 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Glauber Costa
, (Thu Apr 22, 6:11 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Avi Kivity
, (Fri Apr 23, 2:34 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Jeremy Fitzhardinge
, (Fri Apr 23, 12:22 pm)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Avi Kivity
, (Fri Apr 23, 12:25 pm)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Zachary Amsden
, (Fri Apr 23, 2:31 pm)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Jeremy Fitzhardinge
, (Fri Apr 23, 2:35 pm)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Zachary Amsden
, (Fri Apr 23, 2:41 pm)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Avi Kivity
, (Sat Apr 24, 2:29 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Avi Kivity
, (Sat Apr 24, 2:30 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Jeremy Fitzhardinge
, (Mon Oct 25, 4:30 pm)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Avi Kivity
, (Tue Oct 26, 1:14 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Glauber Costa
, (Tue Oct 26, 3:49 am)
Re: [PATCH 1/5] Add a global synchronization point for pvclock
, Jeremy Fitzhardinge
, (Tue Oct 26, 10:04 am)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Michael Trimarchi
Re: [PATCH] VFS: make file->f_pos access atomic on 32bit arch
Miklos Szeredi
[patch 14/15] vfs: more path_permission() conversions
Serge E. Hallyn
Re: [RFC v5][PATCH 7/8] Infrastructure for shared objects
Bernd Schmidt
Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3
Takashi Iwai
[PATCH 2/2] input: Add LED support to Synaptics device
git
:
Junio C Hamano
Re: mingw, windows, crlf/lf, and git
Eyvind Bernhardsen
Re: Where has "git ls-remote" reference pattern matching gone?
Shawn O. Pearce
Re: Switching from CVS to GIT
Todd Zullinger
Re: [PATCH 2/2] send-email: rfc2047-quote subject lines with non-ascii characters
Santi Béjar
Re: How to use git-fmt-merge-msg?
linux-netdev
:
Ramkrishna Vepa
[net-2.6 PATCH 1/10] Neterion: New driver: Driver help file
Mark Anthony
invitation / inquiry
Ingo Molnar
Re: [PATCH 08/16] dma-debug: add core checking functions
David Miller
Re: [PATCH 1/3] f_phonet: dev_kfree_skb instead of dev_kfree_skb_any in TX callback
Sascha Hauer
[PATCH 03/12] fec: do not typedef struct types
git-commits-head
:
Linux Kernel Mailing List
amba: struct device - replace bus_id with dev_name(), dev_set_name()
Linux Kernel Mailing List
MIPS: Yosemite: Convert SMP startup lock to arch spinlock.
Linux Kernel Mailing List
ARM: S5PC100: IRQ and timer
Linux Kernel Mailing List
davinci: edma: clear interrupt status for interrupt enabled channels only
Linux Kernel Mailing List
x86, mm, kprobes: fault.c, simplify notify_page_fault()
openbsd-misc
:
Daniel A. Ramaley
Re: [semi-OT] Can anyone recommend an OpenBSD-compatible colour laser printer?
Matthias Kilian
Re: can't get vesa @ 1280x800 or nv
Tobias Ulmer
Re: Problem after upgrade 4.5 to 4.6: ERR M
Philip Guenther
Re: SIGCHLD and libpthread.so
J.C. Roberts
Re: [semi-OT] Can anyone recommend an OpenBSD-compatible colour laser printer?
Colocation donated by:
Syndicate