On Mon, Apr 24, 2017 at 12:19:47PM -0300, Lauro Venancio wrote: > On 04/24/2017 11:27 AM, Peter Zijlstra wrote:
> >>> Also, would it not make sense to re-order patch 2 to come after this, > >>> such that we _do_ have the group_mask available and don't have to jump > >>> through hoops in order to link up the sgc? Afaict we don't actually use > >>> the sgc until the above (reverse) loop computing the CPU capacities. > Yes, it has the same result. I duplicated the build_group_mask magic to > avoid building the complete mask for all instances of a group. > Currently, the mask is built just once per group. OK, but it was subtly different (using sched_domain_span(sibling) vs sched_group_cpus(sibling->groups)). And if there's anything this code could do with less of its confusion. I see your point about wasted computation, but this is very slow path code, nobody should care too much. And I much prefer simpler code. I'll see if I can come up with some coherent comments as well. This code certainly can use some.