From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757500AbbE3D4A (ORCPT ); Fri, 29 May 2015 23:56:00 -0400 Received: from mail-wg0-f50.google.com ([74.125.82.50]:34770 "EHLO mail-wg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750836AbbE3Dzx (ORCPT ); Fri, 29 May 2015 23:55:53 -0400 Message-ID: <1432958149.3434.37.camel@gmail.com> Subject: Re: [PATCH RESEND] sched: prefer an idle cpu vs an idle sibling for BALANCE_WAKE From: Mike Galbraith To: Josef Bacik Cc: Peter Zijlstra , riel@redhat.com, mingo@redhat.com, linux-kernel@vger.kernel.org, morten.rasmussen@arm.com, kernel-team Date: Sat, 30 May 2015 05:55:49 +0200 In-Reply-To: <5568D43D.20703@fb.com> References: <1432761736-22093-1-git-send-email-jbacik@fb.com> <20150528102127.GD3644@twins.programming.kicks-ass.net> <20150528110514.GR18673@twins.programming.kicks-ass.net> <5568D43D.20703@fb.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.11 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2015-05-29 at 17:03 -0400, Josef Bacik wrote: > for_each_lower_domain(sd) { > sg = sd->groups; > do { > if (!cpumask_intersects(sched_group_cpus(sg), > tsk_cpus_allowed(p))) > goto next; > > for_each_cpu(i, sched_group_cpus(sg)) { > if (i == target || !idle_cpu(i)) > goto next; > } > > return cpumask_first_and(sched_group_cpus(sg), > tsk_cpus_allowed(p)); > next: > sg = sg->next > } while (sg != sd->groups); > } > > We get all the schedule groups for the schedule domain and if any of the > cpu's are not idle or the target then we skip the whole scheduling > group. Isn't the scheduling group a group of CPU's? Why can't we pick > an idle CPU in the group that has a none idle cpu or the target cpu? > Thanks, We select an idle core if we can get one. Yes, that leaves a pile of SMT threads not checked/selected, but if you're gonna do a full search of a large socket (humongous sparc-thing, shudder), you may as well eat the BALANCE_WAKE overhead. -Mike