Messages in this thread | | | Date | Fri, 5 Jun 2015 11:48:20 +0200 (CEST) | From | Thomas Gleixner <> | Subject | Re: [PATCH 08/14] hrtimer: Allow hrtimer::function() to free the timer |
| |
On Fri, 5 Jun 2015, Peter Zijlstra wrote: > /* > + * We require the migration_base for lock_hrtimer_base()/switch_hrtimer_base() > + * such that hrtimer_callback_running() can unconditionally dereference > + * timer->base->cpu_base > + */ > +static struct hrtimer_cpu_base migration_cpu_base = { > + .seq = SEQCNT_ZERO(migration_cpu_base), > +}; > + > +static struct hrtimer_clock_base migration_base = { > + .cpu_base = &migration_cpu_base, > +};
You can spare that extra migration clock base, because migration_cpu_base already has clock bases inside.
static struct hrtimer_cpu_base migration_cpu_base = { .seq = SEQCNT_ZERO(migration_cpu_base), };
and do:
migration_cpu_base.clock_base[CLOCK_MONOTONIC].cpu_base = &migration_cpu_base;
in hrtimer_init.
So migration base becomes:
#define migration_base &migration_cpu_base.clock_base[CLOCK_MONOTONIC]
That's also more efficient in terms of cache because is two adjacent cache lines instead of two distant ones.
Other than that, this looks good.
Thanks,
tglx
| |