Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp1847187imm; Fri, 6 Jul 2018 07:33:32 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdvK0wiZERLYkJtvYoX4jF5a3mtToJznx3/D/dY1Hdp15AQbLGbBXzQShvMiQF0LvpJePh8 X-Received: by 2002:a17:902:b20d:: with SMTP id t13-v6mr10688502plr.121.1530887612819; Fri, 06 Jul 2018 07:33:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530887612; cv=none; d=google.com; s=arc-20160816; b=vt1TnLAiMj8XIJLFvV+b9Ty4SYoYRqPYxrL4XUlzxf6bYSLlSDkL/hP6MyHKb8GlNl GxvS8SgS2XXHsBFl/i2c6PMO6EEcozQpTnz8Gpe6Z9H3D5q3Vlopkg+icjUBkpHYgwxc N3UTSPbGfapGduBCz35sj5fMPhRYTD/csDYzk+Ng+XWWm67NirjVMxY78u6FK4sXDGL3 EJvnTrARR8byXiRJ7elVs6ZtLyb3KqpVbH58hd1i2xVrCarNsXicQbpl5uylcaE5OS9k Shw1BCUDIl6ezM1eY2cmi9YhCfrgvgXgZAD/vWrE6+g5mlNwy4YUN7g63WvSdBRGj9qu jFiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=Ade6KUitruYwtDu/i0Ydt0aw/RNvaIvQ7faQz8v/n6g=; b=yyz5+KlaSZboZf5HEjDpx9HYQMfD2WdzxyjmD12Lme0MqQlNh9qM33c4xGrwMDDteT MgDeN5hmpavMHfwyV4L6+3Nf0sqYdBn9y7dz2Bx+omR/3BRkpsBFWDNZo+6WRIfGh38O dVjLa4VF/r5nz2GaTaYKPpvDskAxnlR89yDIcpL0nyvtkLlzs1Ww6U0UNO/aQPRGS5di 5/7qAAEeNRvRSypAv0Xn2rzd0qI1ny9M0zvyb9GsTAeaZr2yNFkNQpk2CbYYxZ6olUE2 TwADjVtohtfsStBBkdxihpJQ0eM6HR+sDlRYBF3RqyNjaGtbbpqRWikNsrQl1acP7SPR JARg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c2-v6si8372980plb.77.2018.07.06.07.33.18; Fri, 06 Jul 2018 07:33:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933125AbeGFObo (ORCPT + 99 others); Fri, 6 Jul 2018 10:31:44 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:37720 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932725AbeGFObn (ORCPT ); Fri, 6 Jul 2018 10:31:43 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F37BA15B2; Fri, 6 Jul 2018 07:31:42 -0700 (PDT) Received: from e105550-lin.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9D2F33F2EA; Fri, 6 Jul 2018 07:31:41 -0700 (PDT) Date: Fri, 6 Jul 2018 15:31:39 +0100 From: Morten Rasmussen To: Vincent Guittot Cc: Peter Zijlstra , Ingo Molnar , Valentin Schneider , Dietmar Eggemann , gaku.inami.xh@renesas.com, linux-kernel Subject: Re: [PATCHv4 12/12] sched/core: Disable SD_PREFER_SIBLING on asymmetric cpu capacity domains Message-ID: <20180706143139.GE8596@e105550-lin.cambridge.arm.com> References: <1530699470-29808-1-git-send-email-morten.rasmussen@arm.com> <1530699470-29808-13-git-send-email-morten.rasmussen@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 06, 2018 at 12:18:17PM +0200, Vincent Guittot wrote: > On Wed, 4 Jul 2018 at 12:18, Morten Rasmussen wrote: > > > > The 'prefer sibling' sched_domain flag is intended to encourage > > spreading tasks to sibling sched_domain to take advantage of more caches > > and core for SMT systems. It has recently been changed to be on all > > non-NUMA topology level. However, spreading across domains with cpu > > capacity asymmetry isn't desirable, e.g. spreading from high capacity to > > low capacity cpus even if high capacity cpus aren't overutilized might > > give access to more cache but the cpu will be slower and possibly lead > > to worse overall throughput. > > > > To prevent this, we need to remove SD_PREFER_SIBLING on the sched_domain > > level immediately below SD_ASYM_CPUCAPACITY. > > This makes sense. Nevertheless, this patch also raises a scheduling > problem and break the 1 task per CPU policy that is enforced by > SD_PREFER_SIBLING. Scheduling one task per cpu when n_task == n_cpus on asymmetric topologies is generally broken already and this patch set doesn't fix that problem. SD_PREFER_SIBLING might seem to help in very specific cases: n_litte_cpus == n_big_cpus. In that case the little group might classified as overloaded. It doesn't guarantee that anything gets pulled as the grp_load/grp_capacity in the imbalance calculation on some system still says the little cpus are more loaded than the bigs despite one of them being idle. That depends on the little cpu capacities. On systems where n_little_cpus != n_big_cpus SD_PREFER_SIBLING is broken as it assumes the group_weight to be the same. This is the case on Juno and several other platforms. IMHO, SD_PREFER_SIBLING isn't the solution to this problem. It might help for a limited subset of topologies/capacities but the right solution is to change the imbalance calculation. As the name says, it is meant to spread tasks and does so unconditionally. For asymmetric systems we would like to consider cpu capacity before migrating tasks. > When running the tests of your cover letter, 1 long > running task is often co scheduled on a big core whereas short pinned > tasks are still running and a little core is idle which is not an > optimal scheduling decision This can easily happen with SD_PREFER_SIBLING enabled too so I wouldn't say that this patch breaks anything that isn't broken already. In fact we this happening with and without this patch applied. Morten