Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp610737pxk; Fri, 11 Sep 2020 16:06:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxWtclvid5al3UyVfxn5OYqRx5zGWVXJ/llgl9gpL+19NHFY8OccnroRkF321tGxtc/jRx X-Received: by 2002:a50:fb0e:: with SMTP id d14mr5264991edq.172.1599865595201; Fri, 11 Sep 2020 16:06:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599865595; cv=none; d=google.com; s=arc-20160816; b=hXTyNe/lMSVzFdCcUMDJyxwGXieJMQMDi/GCG/TWA91iRYxtkH7id/GDLoNg2toaOC kUfo7DNBSYroixi9+soN+4ImnPFzl5FwRTSEqfWJlEcIjA848iotLGfgkjtYXGpmFTHX m1M4ytrqnx0NMsvicGIXCxTVMs3Qm3ja4e9YgvAp2CR+ZAWwgP6aX7W0kKR5Y90GpgA/ z2FuiHFsDfKt6L08Qp3utSN5hbwr+i2qzI557/0+j7hizRsmDyHrhi2E0uY8QToX4YTp phzzZO1AOoLNe51vaVpglsD11UshmXkEmAWyn/aIsyYz127tz9BQCfGaw7Rx6QcVwYxA yZ6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:ironport-sdr:ironport-sdr; bh=zwQOss24mRCERy1fSNIQN16YZZNoK9RNCllJCW+gaI4=; b=MOmjl2k5Xr9DEd3Wa8kl0myaIWbF9PUrLdbYD+r2ngl3zx6C0tZSrMfX6J4yayLGyj o5sCtdBQIGgVOZbbxv38Qx3QXSU6tZTUzp/gpHktYAmDUBkTtLeksZzTGIho3+TMrL4w E+QLdcZtkWc1r7f79rKLbYDFoKzLo7i91TK/7ed0Qo0XvNuL3ZEyYBUB1r5T6LRNOp3H brDu3UbAP3IqqHyKlyet++Xf70nRoGqRzzZBmzdeWE4iuQE1gJWoVP8qORE5iXAxtWYo kQJR2/zhsIBSDSqUuFH9ZzcSHJgV4kZxXoekemhLl0VeYBtNEcrlewT5Mq3ba16h8m+n n7Cg== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l21si2312160edq.277.2020.09.11.16.06.12; Fri, 11 Sep 2020 16:06:35 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725890AbgIKXEg (ORCPT + 99 others); Fri, 11 Sep 2020 19:04:36 -0400 Received: from mga07.intel.com ([134.134.136.100]:19605 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725849AbgIKXEd (ORCPT ); Fri, 11 Sep 2020 19:04:33 -0400 IronPort-SDR: yZo4Cmn3O6DcRnIOiRCEdWj7yovPzufylFKOZ7l55roGWRg6gQ0Brwn93x8Mfwhg3yNVoCSY6s lCgfimZJRBGw== X-IronPort-AV: E=McAfee;i="6000,8403,9741"; a="223055862" X-IronPort-AV: E=Sophos;i="5.76,418,1592895600"; d="scan'208";a="223055862" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Sep 2020 16:04:33 -0700 IronPort-SDR: kYLC0J520T7BuTfEgd5jB1ZZWP+1UJHZ+qzj8dmufexyzg3NZNp+gieJvTOB31RH1fa15k2HOM UEJZlURmDvbg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,418,1592895600"; d="scan'208";a="329947624" Received: from cli6-desk1.ccr.corp.intel.com (HELO [10.239.161.135]) ([10.239.161.135]) by fmsmga004.fm.intel.com with ESMTP; 11 Sep 2020 16:04:30 -0700 Subject: Re: [RFC PATCH v1 1/1] sched/fair: select idle cpu from idle cpumask in sched domain To: Qais Yousef , Aubrey Li Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, valentin.schneider@arm.com, tim.c.chen@linux.intel.com, linux-kernel@vger.kernel.org References: <20200910054203.525420-1-aubrey.li@intel.com> <20200910054203.525420-2-aubrey.li@intel.com> <20200911162853.xldy6fvvqph2lahj@e107158-lin.cambridge.arm.com> From: "Li, Aubrey" Message-ID: <3f1571ea-b74c-fc40-2696-39ef3fe8b968@linux.intel.com> Date: Sat, 12 Sep 2020 07:04:29 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200911162853.xldy6fvvqph2lahj@e107158-lin.cambridge.arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/9/12 0:28, Qais Yousef wrote: > On 09/10/20 13:42, Aubrey Li wrote: >> Added idle cpumask to track idle cpus in sched domain. When a CPU >> enters idle, its corresponding bit in the idle cpumask will be set, >> and when the CPU exits idle, its bit will be cleared. >> >> When a task wakes up to select an idle cpu, scanning idle cpumask >> has low cost than scanning all the cpus in last level cache domain, >> especially when the system is heavily loaded. >> >> Signed-off-by: Aubrey Li >> --- >> include/linux/sched/topology.h | 13 +++++++++++++ >> kernel/sched/fair.c | 4 +++- >> kernel/sched/topology.c | 2 +- >> 3 files changed, 17 insertions(+), 2 deletions(-) >> >> diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h >> index fb11091129b3..43a641d26154 100644 >> --- a/include/linux/sched/topology.h >> +++ b/include/linux/sched/topology.h >> @@ -65,8 +65,21 @@ struct sched_domain_shared { >> atomic_t ref; >> atomic_t nr_busy_cpus; >> int has_idle_cores; >> + /* >> + * Span of all idle CPUs in this domain. >> + * >> + * NOTE: this field is variable length. (Allocated dynamically >> + * by attaching extra space to the end of the structure, >> + * depending on how many CPUs the kernel has booted up with) >> + */ >> + unsigned long idle_cpus_span[]; > > Can't you use cpumask_var_t and zalloc_cpumask_var() instead? I can use the existing free code. Do we have a problem of this? > > The patch looks useful. Did it help you with any particular workload? It'd be > good to expand on that in the commit message. > Odd, that included in patch v1 0/1, did you receive it? Thanks, -Aubrey