Re: [RFC patch 2/5] hrtimer: Make use of the active bases bitfield

From: Peter Zijlstra
Date: Tue Feb 25 2014 - 07:02:04 EST


On Fri, Feb 21, 2014 at 05:56:16PM -0000, Thomas Gleixner wrote:
> - for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) {
> + while (bases) {
> struct hrtimer_clock_base *base;
> struct timerqueue_node *node;
> ktime_t basenow;
> + int idx;
>
> - if (!(cpu_base->active_bases & (1 << i)))
> - continue;
> + idx = __ffs(bases);
> + bases &= ~(1 << idx);
>
> - base = cpu_base->clock_base + i;
> + base = cpu_base->clock_base + idx;
> basenow = ktime_add(now, base->offset);
>
> while ((node = timerqueue_getnext(&base->active))) {

That's crappy for archs that end up using the generic __ffs().

The simply loop we had isn't too bad, why change this?
--
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/