lkml.org 
[lkml]   [2011]   [Jun]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH v3 8/9] KVM-GST: adjust scheduler cpu power
    From
    Date
    On Wed, 2011-06-29 at 11:29 -0400, Glauber Costa wrote:

    > @@ -2063,12 +2092,7 @@ static int irqtime_account_si_update(void)
    >
    > #define sched_clock_irqtime (0)
    >
    > -static void update_rq_clock_task(struct rq *rq, s64 delta)
    > -{
    > - rq->clock_task += delta;
    > -}
    > -
    > -#endif /* CONFIG_IRQ_TIME_ACCOUNTING */

    That relies on the compiler realizing that irq_delta and steal will
    never be used in the below function:

    > static void update_rq_clock_task(struct rq *rq, s64 delta)
    > {
    > + s64 irq_delta = 0, steal = 0;
    >
    > +#ifdef CONFIG_IRQ_TIME_ACCOUNTING
    > irq_delta = irq_time_read(cpu_of(rq)) - rq->prev_irq_time;
    >
    > /*
    > @@ -2023,12 +2034,30 @@ static void update_rq_clock_task(struct rq *rq, s64 delta)
    >
    > rq->prev_irq_time += irq_delta;
    > delta -= irq_delta;
    > +#endif
    > +#ifdef CONFIG_PARAVIRT_TIME_ACCOUNTING
    > + if (static_branch((&paravirt_steal_rq_enabled))) {
    > + int is_idle;
    > + u64 st;
    > +
    > + is_idle = ((rq->curr != rq->idle) ||
    > + irq_count() != HARDIRQ_OFFSET);
    > +
    > + __touch_steal_time(is_idle, delta, &st);
    > +
    > + steal = st * TICK_NSEC;
    > +
    > + delta -= steal;
    > + }
    > +#endif
    > +
    > rq->clock_task += delta;
    >
    > + if ((irq_delta + steal) && sched_feat(NONTASK_POWER))
    > + sched_rt_avg_update(rq, irq_delta + steal);
    > }

    And thus trim the last bit as if(0) and DCE. Did you verify that the
    compiler does indeed do that for !PARAVIRT !IRQ_TIME_ACCOUNTING ?


    \
     
     \ /
      Last update: 2011-06-30 23:57    [W:0.049 / U:1.468 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site