Re: [PATCH v3 5/6] KVM-GST: adjust scheduler cpu power

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux