Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp7298804pxb; Thu, 18 Feb 2021 06:40:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJw7ien12BsesAOInG4qRY4zwJlqW3BO2nLKQ94B7487tN+/G4z7+CFdLpEZgfEIgeMm5HRL X-Received: by 2002:a05:6402:5243:: with SMTP id t3mr4370749edd.361.1613659247056; Thu, 18 Feb 2021 06:40:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613659247; cv=none; d=google.com; s=arc-20160816; b=PjYaMR8/zEa/iJGO2rZAorgs6nzklbnvFIWax9vO3cBW36th/9phzXZqWc8HJIQ+VH lQGC+sLSwY8ouIO/423oOc07L95kvqcUQlPXnOx7wxPwo97b5mL6n1nH93IjuKGRFtLv 6EgcFZxTZKstcX9FbkLtWa1nzxfjk2sq2iSZxAVSLAtZvtMf+v0cVGIZtHLColNkAhVc gFPoh/PYfZOCj6J24aaduz59sT8xPnbYAq9uEdQmKzuLx7FRuCZEy8SgBKEhCJsrolu4 KwlqqeEAZ1WpQwhoH3gVqXPiKL/o0ITaK+r09sKvU2bgHaIg2LxcYOvwXS4pbKobWV8K eJQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:user-agent:references:in-reply-to:subject:cc:to :from; bh=HJ8XY9puE2Eg/+5nTKF/sfwmDfkIAM24YYE7l/wNVUk=; b=HZcIT4rROMY3bpVhF6I8tolAWbBf5GvfjOzXHMSIwnwu336CfIXL3QqU/Qo6T+iHE9 0locO17cbJ/9a+2fhOuf5P2rYzB1gPjImEUc8gBwCXcv9pR6O5UhMNxuvQ2HiGMtVuhP MLuhQW+VYo68MGZgn3sejTsHaZ3hjArvjNRVAzLae4dceJx3Sfyqt08QauKXvxYowHw5 pWcAjlA556nwD/7C5mCRC29UoAP0vqA+e0JaMO3CadFXv7YMg8cHslvEqAbnJJiQuiVA R0vU13PX9Kgd/xsRF+aanUsXgCSXn5W07agkRo2VQjGgRKAviRRkRiQC6LSaGOqNvHpv yhkg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cw5si3489383ejc.182.2021.02.18.06.40.21; Thu, 18 Feb 2021 06:40:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232471AbhBROgQ convert rfc822-to-8bit (ORCPT + 99 others); Thu, 18 Feb 2021 09:36:16 -0500 Received: from foss.arm.com ([217.140.110.172]:50768 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232923AbhBRMmS (ORCPT ); Thu, 18 Feb 2021 07:42:18 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3502B1FB; Thu, 18 Feb 2021 04:41:05 -0800 (PST) Received: from e113632-lin (e113632-lin.cambridge.arm.com [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1A92E3F73D; Thu, 18 Feb 2021 04:41:02 -0800 (PST) From: Valentin Schneider To: "Song Bao Hua \(Barry Song\)" , Peter Zijlstra Cc: "vincent.guittot\@linaro.org" , "mgorman\@suse.de" , "mingo\@kernel.org" , "dietmar.eggemann\@arm.com" , "morten.rasmussen\@arm.com" , "linux-kernel\@vger.kernel.org" , "linuxarm\@openeuler.org" , "xuwei \(O\)" , "Liguozhu \(Kenneth\)" , "tiantao \(H\)" , wanghuiqiang , "Zengtao \(B\)" , Jonathan Cameron , "guodong.xu\@linaro.org" , Meelis Roos Subject: RE: [Linuxarm] Re: [PATCH v2] sched/topology: fix the issue groups don't span domain->span for NUMA diameter > 2 In-Reply-To: References: <20210203111201.20720-1-song.bao.hua@hisilicon.com> <4bdaa3e1a54f445fa8e629ea392e7bce@hisilicon.com> User-Agent: Notmuch/0.21 (http://notmuchmail.org) Emacs/26.3 (x86_64-pc-linux-gnu) Date: Thu, 18 Feb 2021 12:40:53 +0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Barry, On 18/02/21 09:17, Song Bao Hua (Barry Song) wrote: > Hi Valentin, > > I understand Peter's concern is that the local group has different > size with remote groups. Is this patch resolving Peter's concern? > To me, it seems not :-) > If you remove the '&& i != cpu' in build_overlap_sched_groups() you get that, but then you also get some extra warnings :-) Now yes, should_we_balance() only matters for the local group. However I'm somewhat wary of messing with the local groups; for one it means you would have more than one tl now accessing the same sgc->next_update, sgc->{min, max}capacity, sgc->group_imbalance (as Vincent had pointed out). By ensuring only remote (i.e. !local) groups are modified (which is what your patch does), we absolve ourselves of this issue, which is why I prefer this approach ATM. > Though I don’t understand why different group sizes will be harmful > since all groups are calculating avg_load and group_type based on > their own capacities. Thus, for a smaller group, its capacity would > be smaller. > > Is it because a bigger group has relatively less chance to pull, so > load balancing will be completed more slowly while small groups have > high load? > Peter's point is that, if at a given tl you have groups that look like g0: 0-4, g1: 5-6, g2: 7-8 Then g0 is half as likely to pull tasks with load_balance() than g1 or g2 (due to the group size vs should_we_balance()) However, I suppose one "trick" to be aware of here is that since your patch *doesn't* change the local group, we do have e.g. on CPU0: [ 0.374840] domain-2: span=0-5 level=NUMA [ 0.375054] groups: 0:{ span=0-3 cap=4003 }, 4:{ span=4-5 cap=1988 } *but* on CPU4 we get: [ 0.387019] domain-2: span=0-1,4-7 level=NUMA [ 0.387211] groups: 4:{ span=4-7 cap=3984 }, 0:{ span=0-1 cap=2013 } IOW, at a given tl, all *local* groups have /roughly/ the same size and thus similar pull probability (it took me writing this mail to see it that way). So perhaps this is all fine already?