Re: [patch] x86: unify/rewrite SMP TSC sync code

From: Ben Greear
Date: Fri Nov 24 2006 - 17:48:41 EST


Ingo Molnar wrote:
nor can the TSC really be synced up properly in the hotplug CPU case, after the fact - what if the app already read out an older TSC value and a new CPU is added. If the TSC isnt sync on SMP then it quickly gets pretty messy, and we should rather take a look at /why/ these apps are using RDTSC.

I've been using RDTSC in pktgen. For my app, I am just trying to find a quick
way to determine if X nano-seconds have elapsed. If it's occasionally off by a small amount,
that is OK as I have higher-level control logic that will correct long-term trends.

After poking around, I ended up just exporting sched_clock() and using that
instead of directly using RDTSC, but that was mostly just for convenience.

If RDTSC is not a good choice for the use I describe above, is there a better
method that is still very fast (as compared to do_gettimeofday())?

Thanks,
Ben

--
Ben Greear <greearb@xxxxxxxxxxxxxxx> Candela Technologies Inc http://www.candelatech.com


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/