[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1297451145.5226.88.camel@laptop>
Date: Fri, 11 Feb 2011 20:05:45 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Glauber Costa <glommer@...hat.com>
Cc: kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
Rik van Riel <riel@...hat.com>,
Jeremy Fitzhardinge <jeremy.fitzhardinge@...rix.com>,
Avi Kivity <avi@...hat.com>,
Venkatesh Pallipadi <venki@...gle.com>
Subject: Re: [PATCH v3 5/6] KVM-GST: adjust scheduler cpu power
On Fri, 2011-02-11 at 13:19 -0500, Glauber Costa wrote:
> 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;
>
> /*
> @@ -1926,20 +1932,24 @@ 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
>
> + steal = steal_time_clock(cpu_of(rq)) - rq->prev_steal_time;
>
> + if (steal > delta)
> + steal = delta;
> +
> + rq->prev_steal_time += steal;
> +
> + delta -= steal;
> +#endif
>
> rq->clock_task += delta;
>
> + if ((irq_delta + steal) && sched_feat(NONTASK_POWER))
> + sched_rt_avg_update(rq, irq_delta + steal);
> +}
I think we should make both these conditional, like:
#ifdef CONFIG_IRQ_TIME_ACCOUNTING
if (sched_clock_irqtime) {
/* ... magic ... */
}
#endif
#ifdef CONFIG_PARAVIRT_TIME_ACCOUNTING
if (sched_paravirt_time) {
/* ... magic ... */
}
#endif
Once the jump-label stuff gets a bit better we could use the if
(static_branch()) magic to avoid pretty much all cost.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists