Re: [patch 1/2] round_jiffies infrastructure

Andi Kleen
2006-10-16T13:42:55Z

Arjan van de Ven <arjan@linux.intel.com> writes:
> +}
> +EXPORT_SYMBOL_GPL(__round_jiffies);

This means non GPL modules will disturb your timers again. probably not
a good strategy.

> +
> +unsigned long __round_jiffies_relative(unsigned long T, int CPU)
> +{
> + int rem;
> + int original = T;
> + T=T+jiffies;
> + rem = T % HZ;
> + if (rem < HZ/4)
> + T = T - rem;
> + else
> + T = T - rem + HZ;
> + /* we don't want all cpus firing at once hitting the same lock/memory */
> + T += CPU * 3;

Consider a dual core Yonah/Merom: it has shared caches and the two cores
can only go to sleep together. With this the wakeups will be always
twice. Not good. I guess you need to add some topology awareness here
and e.g. only spread it for sockets.

BTW we normally put spaces around operators inside expressions.

-Andi