Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3744975pxb; Tue, 26 Jan 2021 03:44:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJwPswGHUcOjXnpvh7ns4BwITUVVo7dNOdh/gZ5jsUsrz6e75loc1ZEsTBzWYYNp5efx9CDL X-Received: by 2002:aa7:ca55:: with SMTP id j21mr4198732edt.172.1611661498374; Tue, 26 Jan 2021 03:44:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611661498; cv=none; d=google.com; s=arc-20160816; b=cJR68zJMbstH14r6SECB7fWW09VtpTlbD3cMjk50TP7Ja5HIetpQZoaIOraOPcZDE6 u45Wi45cR22sQKl4gnyRFnxZK0SYEabwbR9HNgjZaBnjrf4h1noU0KJ3zp3aNrgeADCa l+v0m215xbsd1k+Adi7+Bd0984N6L5nCyCnA4a6HpubrK/6/fXeMyYLeCR942mwEyIcM XfeKy+vlLY+eM5UX7dyRrO+DEolVItjL/tQlBGEI5EX6RhyVWFhZt50fZuxXVE6j100i rJg7gzF5wRX3xkGho8pxioc2Vn5Us6pTCjNQDk5FVdmLXD22Ibtpn9+L/3duat8QnaUz bvrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=7taqAP23pPnleabLW/Bf888Zm2v1NayfGpoWqy7fGTM=; b=zg93CDlr11F9dFH12P33m3ofNb362o3HzSzhGkhIS5igDnNHHczhicJzzU6eFZAqoh UfZ9Kbqm2ev/i2juCLxd1TcyoLa7HTpDUcXLpMeoFlp+OQVrs2FLOQ72jVHS5+AZR8nV IqJFgipLMHgJuWx6XLMm24uXx1kB6O5LhHvKOWCX4Kl8NHmuQGb9msT74fi/4VuBjkKn MkMYoM/1MJBSJocTkatdd+p9Dxqc+y1+1L3MurqCNvbu3xmaPS71IqPlfaXi/JsdN1jA YFVe63lguxxSNUG8BFDstjjSAvVEn9HFFcbEq40mEBEdf3KrP0zw3tQ7IGgZYeEYD7Ok cZmw== 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 b21si7036124ejv.648.2021.01.26.03.44.34; Tue, 26 Jan 2021 03:44:58 -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 S2405047AbhAZLm4 (ORCPT + 99 others); Tue, 26 Jan 2021 06:42:56 -0500 Received: from foss.arm.com ([217.140.110.172]:33680 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732252AbhAZLDY (ORCPT ); Tue, 26 Jan 2021 06:03:24 -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 D71C7D6E; Tue, 26 Jan 2021 03:02:38 -0800 (PST) Received: from [192.168.178.6] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B0A9E3F66B; Tue, 26 Jan 2021 03:02:33 -0800 (PST) Subject: Re: [RFC PATCH v3 0/2] scheduler: expose the topology of clusters and add cluster scheduler To: "Song Bao Hua (Barry Song)" , Morten Rasmussen , Tim Chen Cc: "valentin.schneider@arm.com" , "catalin.marinas@arm.com" , "will@kernel.org" , "rjw@rjwysocki.net" , "vincent.guittot@linaro.org" , "lenb@kernel.org" , "gregkh@linuxfoundation.org" , Jonathan Cameron , "mingo@redhat.com" , "peterz@infradead.org" , "juri.lelli@redhat.com" , "rostedt@goodmis.org" , "bsegall@google.com" , "mgorman@suse.de" , "mark.rutland@arm.com" , "sudeep.holla@arm.com" , "aubrey.li@linux.intel.com" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "linux-acpi@vger.kernel.org" , "linuxarm@openeuler.org" , "xuwei (O)" , "Zengtao (B)" , "tiantao (H)" References: <20210106083026.40444-1-song.bao.hua@hisilicon.com> <737932c9-846a-0a6b-08b8-e2d2d95b67ce@linux.intel.com> <20210108151241.GA47324@e123083-lin> <99c07bdf-02d1-153a-bd1e-2f4200cc67c5@linux.intel.com> <20210111092811.GB47324@e123083-lin> <4fdc781e-7385-2ae6-d9c9-3ec165f473c4@arm.com> <076088f4daf64727b1587b162eb08dda@hisilicon.com> From: Dietmar Eggemann Message-ID: Date: Tue, 26 Jan 2021 12:02:21 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <076088f4daf64727b1587b162eb08dda@hisilicon.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25/01/2021 11:50, Song Bao Hua (Barry Song) wrote: > >> -----Original Message----- >> From: Dietmar Eggemann [mailto:dietmar.eggemann@arm.com] >> Sent: Wednesday, January 13, 2021 12:00 AM >> To: Morten Rasmussen ; Tim Chen >> >> Cc: Song Bao Hua (Barry Song) ; >> valentin.schneider@arm.com; catalin.marinas@arm.com; will@kernel.org; >> rjw@rjwysocki.net; vincent.guittot@linaro.org; lenb@kernel.org; >> gregkh@linuxfoundation.org; Jonathan Cameron ; >> mingo@redhat.com; peterz@infradead.org; juri.lelli@redhat.com; >> rostedt@goodmis.org; bsegall@google.com; mgorman@suse.de; >> mark.rutland@arm.com; sudeep.holla@arm.com; aubrey.li@linux.intel.com; >> linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; >> linux-acpi@vger.kernel.org; linuxarm@openeuler.org; xuwei (O) >> ; Zengtao (B) ; tiantao (H) >> >> Subject: Re: [RFC PATCH v3 0/2] scheduler: expose the topology of clusters and >> add cluster scheduler >> >> On 11/01/2021 10:28, Morten Rasmussen wrote: >>> On Fri, Jan 08, 2021 at 12:22:41PM -0800, Tim Chen wrote: >>>> >>>> >>>> On 1/8/21 7:12 AM, Morten Rasmussen wrote: >>>>> On Thu, Jan 07, 2021 at 03:16:47PM -0800, Tim Chen wrote: >>>>>> On 1/6/21 12:30 AM, Barry Song wrote: [...] >> wake_wide() switches between packing (select_idle_sibling(), llc_size >> CPUs) and spreading (find_idlest_cpu(), all CPUs). >> >> AFAICS, since none of the sched domains set SD_BALANCE_WAKE, currently >> all wakeups are (llc-)packed. > > Sorry for late response. I was struggling with some other topology > issues recently. > > For "all wakeups are (llc-)packed", > it seems you mean current want_affine is only affecting the new_cpu, > and for wake-up path, we will always go to select_idle_sibling() rather > than find_idlest_cpu() since nobody sets SD_WAKE_BALANCE in any > sched_domain ? > >> >> select_task_rq_fair() >> >> for_each_domain(cpu, tmp) >> >> if (tmp->flags & sd_flag) >> sd = tmp; >> >> >> In case we would like to further distinguish between llc-packing and >> even narrower (cluster or MC-L2)-packing, we would introduce a 2. level >> packing vs. spreading heuristic further down in sis(). > > I didn't get your point on "2 level packing". Would you like > to describe more? It seems you mean we need to have separate > calculation for avg_scan_cost and sched_feat(SIS_) for cluster > (or MC-L2) since cluster and llc are not in the same level > physically? By '1. level packing' I meant going sis() (i.e. sd=per_cpu(sd_llc, target)) instead of routing WF_TTWU through find_idlest_cpu() which uses a broader sd span (in case all sd's (or at least up to an sd > llc) would have SD_BALANCE_WAKE set). wake_wide() (wakee/waker flip heuristic) is currently used to make this decision. But since no sd sets SD_BALANCE_WAKE we always go sis() for WF_TTWU. '2. level packing' would be the decision between cluster- and llc-packing. The question was which heuristic could be used here. >> IMHO, Barry's current implementation doesn't do this right now. Instead >> he's trying to pack on cluster first and if not successful look further >> among the remaining llc CPUs for an idle CPU. > > Yes. That is exactly what the current patch is doing. And this will be favoring cluster- over llc-packing for each task instead.