Re: [patch 1/2] round_jiffies infrastructure

From: Andi Kleen
Date: Mon Oct 16 2006 - 09:43:15 EST


Arjan van de Ven <arjan@xxxxxxxxxxxxxxx> 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
-
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/