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

From: Srikar Dronamraju
Date: Wed Nov 13 2013 - 06:23:43 EST


* Preeti Murthy <preeti.lkml@xxxxxxxxx> [2013-11-13 16:22:37]:

> Hi Srikar,
>
> update_group_power() is called only during load balancing during
> update_sg_lb_stats().
> Load balancing begins at the base domain of the CPU,rq(cpu)->sd. This is
> checked for
> NULL. So how can update_group_power() be called in a scenario where the
> base domain
> of the CPU is not initialized? I say 'initialized' since you check for NULL
> on rq(cpu)->sd.
>

update_group_power() also gets called from init_sched_groups_power().
And if you see the oops message, we know that the oops happens from that
path. In build_sched_domains(), we do cpu_attach_domain() what updates
rq->sd after the call to init_sched_groups_power(). So by the time
init_sched_groups_power() is called rq->sd is not yet initialized.

We only hit oops case, when the sd->flags has SD_OVERLAP set.



> In the changelog, you say 'updated'. Are you saying that it has a stale
> value?

I said, "before the sched_domain for a cpu is updated", so its not yet
updated or has stale value. As I said earlier in this mail, the
initialization happens after we do a update_group_power().

> Please do elaborate on how you observed this.
>

Does this clarify?

--
Thanks and Regards
Srikar Dronamraju

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/