On 3/22/2013 1:37 PM, Henrik Austad wrote:
> ns2cycles use per_cpu variables, and will, eventually, find its way into
> smp_processord_id(). The latter must be called with either preempt
> disabled, irq's off, from a thread locked to a single core or early in
> the bootprocess (according to debug_smp_processor_id())

A better fix would be to use __raw_get_cpu_var() in ns2cycles(), along with a 
comment saying that the frequency of the tile timer is the same on all cores, 
so it doesn't matter which copy of the per-cpu structure we look at.

I don't object to the performance hit of the preemption calls so much as the 
confusing aspect of why it appears we need to disable preemption to compute the 
value, but not to use it :-)

-- 
Chris Metcalf, Tilera Corp.
http://www.tilera.com

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

Reply via email to