Date: Fri, 15 Dec 2006 23:20:36 +0530 From: "Joseph Koshy" <joseph.koshy@gmail.com> To: mldodson@houston.rr.com Cc: freebsd-hackers@freebsd.org Subject: Re: "Syncing cpus" on a multi-cpu, dual core system Message-ID: <84dead720612150950p33c9c35erffe4adbab7227e68@mail.gmail.com> In-Reply-To: <200612141437.28724.mldodson@houston.rr.com> References: <200612141437.28724.mldodson@houston.rr.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> frequency but something else in addition. A posting in the > thread said variations less than 0.1% were not problematic. > However, the poster said it was an issue in a dual cpu, dual > core system he had set up. Why would application code care about CPU frequencies? Is it trying to measure its 'performance' by subtracting two TSC readings? That won't necessarily work on modern multi-CPU systems where each CPU could be running at a different CPU speed. On FreeBSD, with hwpmc(4), you can allocate a process-mode counting pmc that counts non-sleep cycles (e.g., "p4-global-power-events,mask=running" on an Intel P4) and then use RDPMC instructions where you would have used RDTSC instructions. This is as cheap as the RDTSC technique and will work on SMP systems. -- FreeBSD Volunteer, http://people.freebsd.org/~jkoshy/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?84dead720612150950p33c9c35erffe4adbab7227e68>