From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932920AbcFBOVR (ORCPT ); Thu, 2 Jun 2016 10:21:17 -0400 Received: from merlin.infradead.org ([205.233.59.134]:50914 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932238AbcFBOVO (ORCPT ); Thu, 2 Jun 2016 10:21:14 -0400 Date: Thu, 2 Jun 2016 16:21:05 +0200 From: Peter Zijlstra To: Morten Rasmussen Cc: mingo@redhat.com, dietmar.eggemann@arm.com, yuyang.du@intel.com, vincent.guittot@linaro.org, mgalbraith@suse.de, linux-kernel@vger.kernel.org Subject: Re: [PATCH 09/16] sched/fair: Let asymmetric cpu configurations balance at wake-up Message-ID: <20160602142105.GG28447@twins.programming.kicks-ass.net> References: <1464001138-25063-1-git-send-email-morten.rasmussen@arm.com> <1464001138-25063-10-git-send-email-morten.rasmussen@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1464001138-25063-10-git-send-email-morten.rasmussen@arm.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 23, 2016 at 11:58:51AM +0100, Morten Rasmussen wrote: > Currently, SD_WAKE_AFFINE always takes priority over wakeup balancing if > SD_BALANCE_WAKE is set on the sched_domains. For asymmetric > configurations SD_WAKE_AFFINE is only desirable if the waking task's > compute demand (utilization) is suitable for the cpu capacities > available within the SD_WAKE_AFFINE sched_domain. If not, let wakeup > balancing take over (find_idlest_{group, cpu}()). > > The assumption is that SD_WAKE_AFFINE is never set for a sched_domain > containing cpus with different capacities. This is enforced by a > previous patch based on the SD_ASYM_CPUCAPACITY flag. > > Ideally, we shouldn't set 'want_affine' in the first place, but we don't > know if SD_BALANCE_WAKE is enabled on the sched_domain(s) until we start > traversing them. I'm a bit confused... Lets assume a 2+2 big.little thing with shared LLC: ---------- SD2 ---------- -- SD1 -- -- SD1 -- 0 1 2 3 SD1: WAKE_AFFINE, BALANCE_WAKE SD2: ASYM_CAPACITY, BALANCE_WAKE t0 used to run on cpu1, t0 used to run on cpu2 cpu0 wakes t0: want_affine = 1 SD1: WAKE_AFFINE cpumask_test_cpu(prev_cpu, sd_mask) == true affine_sd = SD1 break; affine_sd != NULL -> affine-wakeup cpu0 wakes t1: want_affine = 1 SD1: WAKE_AFFINE cpumask_test_cpu(prev_cpu, sd_mask) == false SD2: BALANCE_WAKE sd = SD2 affine_sd == NULL, sd == SD2 -> find_idlest_*() All without this patch... So what is this thing doing?