lkml.org 
[lkml]   [2015]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [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


    \
     
     \ /
      Last update: 2015-06-05 12:01    [W:3.033 / U:0.032 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site