From: Dan Magenheimer Subject: RE: RE: rdtsc: correctness vs performance on Xen (and KVM?) Date: Tue, 1 Sep 2009 09:55:43 -0700 (PDT) Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=Windows-1252 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser , Jan Beulich , Jeremy Fitzhardinge Cc: "Xen-Devel (E-mail)" , Alan Cox List-Id: xen-devel@lists.xenproject.org > >> Not within today's Xen or Linux (which both assume a global kernel > >> address space, in particular non-root page table entries > >> mapping kernel > >> space to be the same in all address spaces - you'd need > >> separate entries > >> at all levels for this). > >=20 > > OK, I forgot: No software-accessible TLB. > >=20 > > Can you think of any trick (that doesn't require the cost of a > > trap/hypercall) to allow an app to determine what pcpu > > it is running on? >=20 > I can't think of any that don't require kernel modifications.=20 > Which takes us > back to considering vsyscall, perhaps. >=20 > -- Keir If a solution that doesn't require kernel mods is not possible, then I suspect apps will continue to use rdtsc as-is and suffer the emulation overhead. Requiring all customers to update the OS underlying these apps is a non-starter. Also, it has yet to be proven that pvclock can work in a vsyscall. Doesn't the same per-cpu in userspace problem exist? Pvclock without vsyscall has been measured and is too slow, so until a vsyscall version of pvclock is implemented and measured (let alone upstream or available in distros), it's hard to call it an alternative to consider, even for the future.