Re: [PATCH] hrtimer: Replace cpu_base->active_bases with a direct check of the active list

From: Thomas Gleixner
Date: Thu Apr 09 2015 - 05:11:49 EST


On Thu, 9 Apr 2015, Ingo Molnar wrote:
> Plus, look at this code in hrtimer_run_queues():
>
> for (index = 0; index < HRTIMER_MAX_CLOCK_BASES; index++) {
> base = &cpu_base->clock_base[index];
> if (!base->active.next)
> continue;
>
> if (gettime) {
> hrtimer_get_softirq_time(cpu_base);
> gettime = 0;
> }
>
> if at least one base is active (on my fairly standard system all cpus
> have at least one active hrtimer base all the time - and many cpus
> have two bases active), then we run hrtimer_get_softirq_time(), which
> dirties the cachelines of all 4 clock bases:
>
> base->clock_base[HRTIMER_BASE_REALTIME].softirq_time = xtim;
> base->clock_base[HRTIMER_BASE_MONOTONIC].softirq_time = mono;
> base->clock_base[HRTIMER_BASE_BOOTTIME].softirq_time = boot;
> base->clock_base[HRTIMER_BASE_TAI].softirq_time = tai;

This is the non highres case and we actually could optimize that case
as well to avoid the cache line polution.

Thanks,

tglx




--
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/