Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp679731pxu; Thu, 3 Dec 2020 09:56:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJw3J0CJG3V2fppJp3LHCbuAw2OzpZk9EGJz6s3ViujEOG0rDwbiZcD8A6eHbTFm1mCAUOi/ X-Received: by 2002:a05:6402:143a:: with SMTP id c26mr3793234edx.131.1607018213982; Thu, 03 Dec 2020 09:56:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607018213; cv=none; d=google.com; s=arc-20160816; b=hSHgA7PFliNneeo29v8nMK3/yh2lKUiUARnxyHZg1AaSJd2VYqAI3upXP+lrcjONKs kJEsXxuWcZBCv56uB//kraYBAsclOPCOJh3lgKiq/DWGA5Bq60n3YX5S43mF1tPhsHp/ xxZsMY4XU1BC/+oBuiYxXsIjYPGt2wmrIttfcR/GS3XIegtN0M+8apMVnxFttSNygEdM btounYlfQPnnN9Csypav8/xX1RC9/BhwTXAYNuMyJJMJiLhxBMc8ILJqvWix6hI7VZ2p mGIdAnW5Pr318vOrpKjDUC2pVP+D6wZiQq7vEevBafKIxb0BgG+DEErO2VUYu66FUj4b NtdA== 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=eRfEcFcXC5XxCEfAUqbngyxnTU9tAha2hwOgG+Slr4Q=; b=FSjbfBHRaJcM2GyIy3rQ2ONIjiBh7w282jBWrNsE5hJjdMatJjoqOKxNvRuvvj3Wqc Y5Oo7MhXxBFp7+oo5DVFsexRlPYNDAXmjWr8i8Bg4fJ0bbJWbRe8qrg0Geo8rM5znEky pyagDvaFcjn7jWAbe7sR0yR1ytUBWw/dEDmwohLvG3B4YhfVCvyaxYeS6Z2GEEwAcaWD jPZoD4uSNhl7Q2Oft38zHVLj3yDo/t9xgyro6Bb1LrK5hhHf87BF8X0zL6D4gBN7F2kG W06yUWNOOdgLBUBG3gx9DC5aAa3j5Q9YwtmsraEpH2dRZ0v6sEYD7fWouAacVPKULtel 68Cg== 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 i88si1539474edd.322.2020.12.03.09.56.30; Thu, 03 Dec 2020 09:56:53 -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 S2389182AbgLCRw6 (ORCPT + 99 others); Thu, 3 Dec 2020 12:52:58 -0500 Received: from outbound-smtp63.blacknight.com ([46.22.136.252]:60717 "EHLO outbound-smtp63.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726222AbgLCRw5 (ORCPT ); Thu, 3 Dec 2020 12:52:57 -0500 Received: from mail.blacknight.com (pemlinmail06.blacknight.ie [81.17.255.152]) by outbound-smtp63.blacknight.com (Postfix) with ESMTPS id 15926FA945 for ; Thu, 3 Dec 2020 17:52:06 +0000 (GMT) Received: (qmail 24498 invoked from network); 3 Dec 2020 17:52:05 -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); 3 Dec 2020 17:52:05 -0000 Date: Thu, 3 Dec 2020 17:52:04 +0000 From: Mel Gorman To: Vincent Guittot Cc: LKML , Aubrey Li , Barry Song , Ingo Molnar , Peter Ziljstra , Juri Lelli , Valentin Schneider , Linux-ARM Subject: Re: [PATCH 06/10] sched/fair: Clear the target CPU from the cpumask of CPUs searched Message-ID: <20201203175204.GY3371@techsingularity.net> References: <20201203141124.7391-1-mgorman@techsingularity.net> <20201203141124.7391-7-mgorman@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 Thu, Dec 03, 2020 at 05:38:03PM +0100, Vincent Guittot wrote: > On Thu, 3 Dec 2020 at 15:11, Mel Gorman wrote: > > > > The target CPU is definitely not idle in both select_idle_core and > > select_idle_cpu. For select_idle_core(), the SMT is potentially > > checked unnecessarily as the core is definitely not idle if the > > target is busy. For select_idle_cpu(), the first CPU checked is > > simply a waste. > > > > > Signed-off-by: Mel Gorman > > --- > > kernel/sched/fair.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > > index 68dd9cd62fbd..1d8f5c4b4936 100644 > > --- a/kernel/sched/fair.c > > +++ b/kernel/sched/fair.c > > @@ -6077,6 +6077,7 @@ static int select_idle_core(struct task_struct *p, struct sched_domain *sd, int > > return -1; > > > > cpumask_and(cpus, sched_domain_span(sd), p->cpus_ptr); > > + __cpumask_clear_cpu(target, cpus); > > should clear cpu_smt_mask(target) as we are sure that the core will not be idle > The intent was that the sibling might still be an idle candidate. In the current draft of the series, I do not even clear this so that the SMT sibling is considered as an idle candidate. The reasoning is that if there are no idle cores then an SMT sibling of the target is as good an idle CPU to select as any. -- Mel Gorman SUSE Labs