Re: [PATCH v2] sched: Check sched_domain before computing group power.

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

 



> +			/*
> +			 * build_sched_domains() -> init_sched_groups_power()
> +			 * gets here before we've attached the domains to the
> +			 * runqueues.
> +			 *
> +			 * Use power_of(), which is set irrespective of domains
> +			 * in update_cpu_power().
> +			 *
> +			 * This avoids power/power_orig from being 0 and
> +			 * causing divide-by-zero issues on boot.
> +			 *
> +			 * Runtime updates will correct power_orig.
> +			 */
> +			if (!rq->sd) {

Because this condition is only true during boot up, I am now
thinking if we should do mark this as unlikely i.e if (unlikely(!rq->sd)) {

Peter, 

Please do let me know if you agree and if you want to spin of a new
version?

> +				power_orig += power_of(cpu);
> +				power += power_of(cpu);
> +				continue;
> +			}
> +
> +			sgp = rq->sd->groups->sgp;
> +			power_orig += sgp->power_orig;
> +			power += sgp->power;
>  		}
>  	} else  {
>  		/*
> 

-- 
Thanks and Regards
Srikar Dronamraju

--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux