Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp119688pxb; Wed, 20 Jan 2021 02:47:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJyWSN+QBlcApqH1Nn2Wi36nb+Rw5zFlLQaJURyNi86796vcSSPHG3szM39vzcZFFzeX1g63 X-Received: by 2002:a50:cf02:: with SMTP id c2mr6749660edk.333.1611139647355; Wed, 20 Jan 2021 02:47:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611139647; cv=none; d=google.com; s=arc-20160816; b=dvrgkDnfstMSp3AwJTCnwEsarmmMmElNaLO+OXdtQKTFetyqqjhpt8yw6DqeeojTz1 TeKMFILuRo4aOF0EDrCTCRAiDzjeCuHISX85GL8zycWH0H0cnQ2AV2XNwgubX9L5ssai FsFZ5x4jXkkLYVCrtgY/A1iAXleQH6EEkejB/UxRpHCHl9sqRjEgoH1U5zUUO6cUNiBa ruRjlVmID6XIewcuQKvjBqhhKwHTwrIL3TyXWn+Xz+ifFmfhQzg2CZw1T7kMcjxn1KxE 5nIKQhoHwnSRWtyQ/osreaPw3l9qlumLWVG2lXM9wTnFDN2/zjWn8+YEHd79Q3Y9fzTl q7HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=cY7pLbxaXAOEJ63mZH5Q4/tsjyDwsBDUKzIUkayPwhQ=; b=sma+wZoyHyigVB0HUtJCEXeMYeKTvQlyGrgEbY3DJ3k0kXRjFQeBv3AzzynVqmZtQe kwlli5MqrdlAsRz/CsiEDisfuz/2D4i3L+u4q0NdUxfqgnmO/rtffimFSsB/o22daiXH y6cKdWL2iqopOIqfy2eAIkt3yWU2nLRTv396fzpgPuHWw3DminxW/yhO6wRn+NPUnJbo EGawF+2WNaaaczNyk7Wqg257L4IlQ7trGvp5bUdzY5M746MJ0c+eN8mfTr+NY4fr+SX3 +qiMuN1VqrfAZz/5+4Y2kkJWBqRHaX8l7+TlnvcGGPYarLv8GEiHBDDsrMppap2teaaE MexA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g11si702726edm.522.2021.01.20.02.47.03; Wed, 20 Jan 2021 02:47:27 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732356AbhATKSU (ORCPT + 99 others); Wed, 20 Jan 2021 05:18:20 -0500 Received: from outbound-smtp53.blacknight.com ([46.22.136.237]:43017 "EHLO outbound-smtp53.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729901AbhATJzO (ORCPT ); Wed, 20 Jan 2021 04:55:14 -0500 Received: from mail.blacknight.com (pemlinmail03.blacknight.ie [81.17.254.16]) by outbound-smtp53.blacknight.com (Postfix) with ESMTPS id 64190FB168 for ; Wed, 20 Jan 2021 09:54:22 +0000 (GMT) Received: (qmail 4203 invoked from network); 20 Jan 2021 09:54:22 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.22.4]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 20 Jan 2021 09:54:22 -0000 Date: Wed, 20 Jan 2021 09:54:20 +0000 From: Mel Gorman To: Vincent Guittot Cc: Gautham R Shenoy , Peter Zijlstra , Ingo Molnar , Li Aubrey , Qais Yousef , LKML Subject: Re: [PATCH 5/5] sched/fair: Merge select_idle_core/cpu() Message-ID: <20210120095420.GU3592@techsingularity.net> References: <20210119112211.3196-1-mgorman@techsingularity.net> <20210119112211.3196-6-mgorman@techsingularity.net> <20210120083018.GA14462@in.ibm.com> <20210120091235.GT3592@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 20, 2021 at 10:21:47AM +0100, Vincent Guittot wrote: > On Wed, 20 Jan 2021 at 10:12, Mel Gorman wrote: > > > > On Wed, Jan 20, 2021 at 02:00:18PM +0530, Gautham R Shenoy wrote: > > > > @@ -6157,18 +6169,31 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int t > > > > } > > > > > > > > for_each_cpu_wrap(cpu, cpus, target) { > > > > - if (!--nr) > > > > - return -1; > > > > - if (available_idle_cpu(cpu) || sched_idle_cpu(cpu)) > > > > - break; > > > > + if (smt) { > > > > + i = select_idle_core(p, cpu, cpus, &idle_cpu); > > > > + if ((unsigned int)i < nr_cpumask_bits) > > > > + return i; > > > > + > > > > + } else { > > > > + if (!--nr) > > > > + return -1; > > > > + i = __select_idle_cpu(cpu); > > > > + if ((unsigned int)i < nr_cpumask_bits) { > > > > + idle_cpu = i; > > > > + break; > > > > + } > > > > + } > > > > } > > > > > > > > - if (sched_feat(SIS_PROP)) { > > > > + if (smt) > > > > + set_idle_cores(this, false); > > > > > > Shouldn't we set_idle_cores(false) only if this was the last idle > > > core in the LLC ? > > > > > > > That would involve rechecking the cpumask bits that have not been > > scanned to see if any of them are an idle core. As the existance of idle > > cores can change very rapidly, it's not worth the cost. > > But don't we reach this point only if we scanned all CPUs and didn't > find an idle core ? Yes, but my understanding of Gauthams suggestion was to check if an idle core found was the last idle core available and set has_idle_cores to false in that case. I think this would be relatively expensive and possibly futile as returning the last idle core for this wakeup does not mean there will be no idle core on the next wakeup as other cores may go idle between wakeups. -- Mel Gorman SUSE Labs