Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp205350pxy; Fri, 30 Apr 2021 03:44:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzeVGELk/otWBthhWKknpXpq/qYXqcPna3tEYjVX6jhrKmjrkZD4yC0ppZWQg8XIKC8Ji/i X-Received: by 2002:a17:903:248e:b029:ec:9c4f:765e with SMTP id p14-20020a170903248eb02900ec9c4f765emr4655896plw.17.1619779443174; Fri, 30 Apr 2021 03:44:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619779443; cv=none; d=google.com; s=arc-20160816; b=0ob2EGBrXQmsUkGYAq65UMIe6MLTxxpcV3kS4kDNTiWePtsm1I10Q5OYwfbdLDprMh TQDsZikIK33wyHKJiNnsKZzMZ+c2oJq77POax4MM1aQ5hFpIb3Jkszi/4Pu092ynwh6D kbVRWnpaoZbfeMwbRL3/d0swY2t9Izfsd8yj32l94GpdEXBZwcr+eT9zwuLzXZ1dnjKq pYoMeGdt03uqaXpzWHbPDAGzYEeeLKdRqYWio/QLhy43DjT0eQWX8+I9IRLyQqjw7ycl NTn2ep4lcpPePhTNxhBDtmZKfUoicJc8tPhbTJkVM3fO0ZHBL9bjSPOLIMP4Z4+5O8jw BQLw== 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=9/h3oTskvOnhdQvG6kIPFhoksN4PxVsuIe+hN36TUgE=; b=I5uwE/kyLS9n2VMNFzQERJ+tedbq+MfMc5U7ZKILXGcd5mureAqkmL1RmwR5AVu7L1 +oqb1U8vr6TUttsm3C+ef5g4zPzO0iWJHR++eFSFTKzjAf3rjuSa1J/8CDBCF9JZOxkp 06WPHMSnRdXQAno3m3q39/bYFirnIZrXoTgGdmd29U+AEKnzPC3GCsfO1r44H9DFRrhP +zTP9gNuIG2NnllXgNQbzyizT6h2yp/l/ihxk9AbFmR15EXC8NH2bTwJD0UvMiA/0CoJ W24GSvcsP6zDUPBwwOeT6fqmSif+I3K+dmDZ+7zf7VwDpmgga4sOvFobJkVZd8NZu1u2 ct2A== 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 j11si3663787pjz.1.2021.04.30.03.43.46; Fri, 30 Apr 2021 03:44:03 -0700 (PDT) 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 S229898AbhD3Kn6 (ORCPT + 99 others); Fri, 30 Apr 2021 06:43:58 -0400 Received: from foss.arm.com ([217.140.110.172]:45010 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229543AbhD3Kn5 (ORCPT ); Fri, 30 Apr 2021 06:43:57 -0400 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 4BBFA31B; Fri, 30 Apr 2021 03:43:09 -0700 (PDT) Received: from [192.168.178.6] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 468CD3F73B; Fri, 30 Apr 2021 03:42:58 -0700 (PDT) Subject: Re: [RFC PATCH v6 3/4] scheduler: scan idle cpu in cluster for tasks within one LLC To: "Song Bao Hua (Barry Song)" , Vincent Guittot Cc: "tim.c.chen@linux.intel.com" , "catalin.marinas@arm.com" , "will@kernel.org" , "rjw@rjwysocki.net" , "bp@alien8.de" , "tglx@linutronix.de" , "mingo@redhat.com" , "lenb@kernel.org" , "peterz@infradead.org" , "rostedt@goodmis.org" , "bsegall@google.com" , "mgorman@suse.de" , "msys.mizuma@gmail.com" , "valentin.schneider@arm.com" , "gregkh@linuxfoundation.org" , Jonathan Cameron , "juri.lelli@redhat.com" , "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" , "x86@kernel.org" , "xuwei (O)" , "Zengtao (B)" , "guodong.xu@linaro.org" , yangyicong , "Liguozhu (Kenneth)" , "linuxarm@openeuler.org" , "hpa@zytor.com" References: <20210420001844.9116-1-song.bao.hua@hisilicon.com> <20210420001844.9116-4-song.bao.hua@hisilicon.com> <80f489f9-8c88-95d8-8241-f0cfd2c2ac66@arm.com> <8b5277d9-e367-566d-6bd1-44ac78d21d3f@arm.com> <185746c4d02a485ca8f3509439328b26@hisilicon.com> From: Dietmar Eggemann Message-ID: Date: Fri, 30 Apr 2021 12:42:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <185746c4d02a485ca8f3509439328b26@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 29/04/2021 00:41, Song Bao Hua (Barry Song) wrote: > > >> -----Original Message----- >> From: Dietmar Eggemann [mailto:dietmar.eggemann@arm.com] [...] >>>>> From: Dietmar Eggemann [mailto:dietmar.eggemann@arm.com] >> >> [...] >> >>>>> On 20/04/2021 02:18, Barry Song wrote: [...] > Though we will never go to slow path, wake_wide() will affect want_affine, > so eventually affect the "new_cpu"? yes. > > for_each_domain(cpu, tmp) { > /* > * If both 'cpu' and 'prev_cpu' are part of this domain, > * cpu is a valid SD_WAKE_AFFINE target. > */ > if (want_affine && (tmp->flags & SD_WAKE_AFFINE) && > cpumask_test_cpu(prev_cpu, sched_domain_span(tmp))) { > if (cpu != prev_cpu) > new_cpu = wake_affine(tmp, p, cpu, prev_cpu, sync); > > sd = NULL; /* Prefer wake_affine over balance flags */ > break; > } > > if (tmp->flags & sd_flag) > sd = tmp; > else if (!want_affine) > break; > } > > If wake_affine is false, the above won't execute, new_cpu(target) will > always be "prev_cpu"? so when task size > cluster size in wake_wide(), > this means we won't pull the wakee to the cluster of waker? It seems > sensible. What is `task size` here? The criterion is `!(slave < factor || master < slave * factor)` or `slave >= factor && master >= slave * factor` to wake wide. I see that since you effectively change the sched domain size from LLC to CLUSTER (e.g. 24->6) for wakeups with cpu and prev_cpu sharing LLC (hence the `numactl -N 0` in your workload), wake_wide() has to take CLUSTER size into consideration. I was wondering if you saw wake_wide() returning 1 with your use cases: numactl -N 0 /usr/lib/lmbench/bin/stream -P [6,12] -M 1024M -N 5