Received: by 10.223.185.116 with SMTP id b49csp833147wrg; Tue, 20 Feb 2018 08:35:10 -0800 (PST) X-Google-Smtp-Source: AH8x226DmfeS0ifOfGBRxzXAgBoTkpzovt9qO8PY6eBelmYwYL5o0Jz9418j35G9xQzplxwCOwht X-Received: by 2002:a17:902:8ec7:: with SMTP id x7-v6mr185439plo.330.1519144510298; Tue, 20 Feb 2018 08:35:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519144510; cv=none; d=google.com; s=arc-20160816; b=yJcbyTP8s3kOWgWnHmMGv2XDZTYG3KUu2addFhrUAvoWp/uQyAv9iXJN6uuyat9zyR Qa26sbkrMVIEHXD/REYqGIBOlwDJqSdXw2IIdToJJ61GPTQ+s0+qwN71of0Ls1gDdGdm n0oz+7kaUrPQK31WTj2eptoCtur9a+6p9uowSMZzpS+j7PmHXUFiRjfufFmTRqZwy53i jjL8w7B6M+env6pX7jAbMJSWSoDeevGpqnAtujbnundzhfcvgGm7uVV49aqNaKjJKUEp qLsajqrvXW91q91noB9GBVPUUPYXaW7XvA1GeYHdSzNeUpE66Hqtqv4vn+2ULA28+kg0 Ueqg== 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=bsPpi6APmc6Oxu0ErEsJnSaTCyvP/cjNTzp/YBfDfDA=; b=rnt9M9hLP18lcWR3lDLTSgcj2zDbq/IituyAAEru8ESc3I9hkcx3x0NCtiQSHaQKTD CT/I6AQLJt5zV5d/84hw8df/4p+Pl5995iQt/vwkR34yNF+xS5FOOFmPC2Mdyv3W/phE WNHtR3yAo0Bh45zq7wQyJdPgkI1lkLAyDz2trIxHsratSaY8HKzIymdqxI14DbBy9QuS aLHZUfrHEMadRzCqV8Hs55Cb/V1o4tSoyhHIMTd3se/llssv1LgdJnt4pHrw5XdIPJbS RAec3WD7Hoc1giYkhAzodPV+IlMcVeLU4F50WE2ijD04M0P3AiPAgDSzqU/VipyO8RIQ B1QA== 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 c74si7632042pfj.339.2018.02.20.08.34.55; Tue, 20 Feb 2018 08:35:10 -0800 (PST) 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 S1752171AbeBTQd5 (ORCPT + 99 others); Tue, 20 Feb 2018 11:33:57 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:45200 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751329AbeBTQd4 (ORCPT ); Tue, 20 Feb 2018 11:33:56 -0500 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 3BBAD80D; Tue, 20 Feb 2018 08:33:56 -0800 (PST) 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 04D883F25C; Tue, 20 Feb 2018 08:33:54 -0800 (PST) Date: Tue, 20 Feb 2018 16:33:52 +0000 From: Morten Rasmussen To: Peter Zijlstra Cc: mingo@redhat.com, valentin.schneider@arm.com, dietmar.eggemann@arm.com, vincent.guittot@linaro.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/7] sched/fair: Avoid unnecessary balancing of asymmetric capacity groups Message-ID: <20180220163352.GD4589@e105550-lin.cambridge.arm.com> References: <1518711654-23503-1-git-send-email-morten.rasmussen@arm.com> <1518711654-23503-5-git-send-email-morten.rasmussen@arm.com> <20180219151011.GI25181@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180219151011.GI25181@hirez.programming.kicks-ass.net> 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 Mon, Feb 19, 2018 at 04:10:11PM +0100, Peter Zijlstra wrote: > On Thu, Feb 15, 2018 at 04:20:51PM +0000, Morten Rasmussen wrote: > > +/* > > + * group_similar_cpu_capacity: Returns true if the minimum capacity of the > > + * compared groups differ by less than 12.5%. > > + */ > > +static inline bool > > +group_similar_cpu_capacity(struct sched_group *sg, struct sched_group *ref) > > +{ > > + long diff = sg->sgc->min_capacity - ref->sgc->min_capacity; > > + long max = max(sg->sgc->min_capacity, ref->sgc->min_capacity); > > + > > + return abs(diff) < max >> 3; > > +} > > This seems a fairly random and dodgy heuristic. I can't deny that :-) We need to somehow figure out if we are doing asymmetric cpu capacity balancing or normal SMP balancing. We probably don't care about migrating tasks if the capacities are nearly identical. But how much is 'nearly'? We could make it strictly equal as long as sgc->min_capacity is based on capacity_orig. If we let things like rt-pressure influence sgc->min_capacity, it might become a mess. We could tie it to sd->imbalance_pct to make it slightly less arbitrary, or we can try to drop the margin. Alternative solutions and preferences are welcome...