Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp320896pxf; Tue, 6 Apr 2021 23:45:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHgmEiW5AUj2PGZix1mJ/S8lwuAdMvz01YMPCvuq4jsw/XFGAGOTZT0nlXkapG0duIyKyl X-Received: by 2002:aa7:cc03:: with SMTP id q3mr2585942edt.366.1617777925865; Tue, 06 Apr 2021 23:45:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617777925; cv=none; d=google.com; s=arc-20160816; b=fMNcQNaCETxZhDlnDRpMWgvSX9KQ1lryMonZex1SI6dYzZ9RTi0ZpwhKiJBcu3JHFa rgYROIFVbj3C1k19uoHd8aJA67Utm5AfUHcquYKJDKaK6HX2V+V+ytlWdNaRAPUGe2Ou RLSZOV8nSO9al92XG39wmQVtCs7SUDobFIxMnCJQsjpXfQkZVxezUDVX+fT29k78CZU3 gX8Nm5eFQRhdn/QMwJnj+iCn4Zf/8oe5woAEaZZs19WU6EC9OVzcAsWZP2G0ACGgH3FY 6EQo+jJaCukevVKuIqmsxe6F/uw6GjLibEJfHAKBIgxTTIgoR0B4Avp+NoWS69F8W5gu +bzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id; bh=XU1qM0ZGJ3tT1O0Q2WcJ21wKjt/xQZKr+z0bRzspSoY=; b=j8JFmtN1yn3T6DlYTd/Hkie3U/jgQMlDDrSpIAILK8sRIf9U7DnZS8OMq6gPV+7FiP dL1W4NIhvWpvheTc//fz9jqR/QEtW9TwQx/oixaOBfvpE5VaD3fjmUZ7mFgdZ54NR5wb 9eamvfSPWkFkXV30NryttoxSWnRTSyui+V54MKnHiWlJjr2VenttMTRN0IgiEoHI6MtG Pd9s7dpsJ/5SFbflSPgXQUFdGUSCWdiwF20CoGsVVQqO7b6g7Y8lV8YchkZmGsQpHA5s qechLDc/NGuZv21X6dDXxo0Xj6mrmemKHqMzP/LbfhPf/l5wFI9GiMcSh5XjJBtktBp9 /ppg== 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 r5si19244751ejr.410.2021.04.06.23.45.02; Tue, 06 Apr 2021 23:45:25 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345632AbhDFP0x (ORCPT + 99 others); Tue, 6 Apr 2021 11:26:53 -0400 Received: from shelob.surriel.com ([96.67.55.147]:32874 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242400AbhDFP0w (ORCPT ); Tue, 6 Apr 2021 11:26:52 -0400 Received: from imladris.surriel.com ([96.67.55.152]) by shelob.surriel.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1lTnbC-0003Pk-GU; Tue, 06 Apr 2021 11:26:38 -0400 Message-ID: <1e21aa6ea7de3eae32b29559926d4f0ba5fea130.camel@surriel.com> Subject: Re: [PATCH v3] sched/fair: bring back select_idle_smt, but differently From: Rik van Riel To: Vincent Guittot Cc: Mel Gorman , linux-kernel , Kernel Team , "Peter Zijlstra (Intel)" , Ingo Molnar , Valentin Schneider Date: Tue, 06 Apr 2021 11:26:37 -0400 In-Reply-To: References: <20210321150358.71ef52b1@imladris.surriel.com> <20210322110306.GE3697@techsingularity.net> <20210326151932.2c187840@imladris.surriel.com> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-h2yb9mmylf3PhyRBn23s" User-Agent: Evolution 3.34.4 (3.34.4-1.fc31) MIME-Version: 1.0 Sender: riel@shelob.surriel.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-h2yb9mmylf3PhyRBn23s Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2021-04-06 at 17:10 +0200, Vincent Guittot wrote: > On Fri, 26 Mar 2021 at 20:19, Rik van Riel wrote: >=20 > > -static int select_idle_cpu(struct task_struct *p, struct > > sched_domain *sd, int target) > > +static int select_idle_cpu(struct task_struct *p, struct > > sched_domain *sd, int prev, int target) > > { > > struct cpumask *cpus =3D > > this_cpu_cpumask_var_ptr(select_idle_mask); > > int i, cpu, idle_cpu =3D -1, nr =3D INT_MAX; > > @@ -6136,23 +6163,32 @@ static int select_idle_cpu(struct > > task_struct *p, struct sched_domain *sd, int t > >=20 > > cpumask_and(cpus, sched_domain_span(sd), p->cpus_ptr); > >=20 > > - if (sched_feat(SIS_PROP) && !smt) { > > - u64 avg_cost, avg_idle, span_avg; > > + if (!smt) { > > + if (cpus_share_cache(prev, target)) { >=20 > Have you checked the impact on no smt system ? would worth a static > branch. >=20 > Also, this doesn't need to be in select_idle_cpu() which aims to loop > the sched_domain becaus you only compare target and prev. So you can > move this call to select_idle_smt() in select_idle_sibling() After Mel's rewrite, there no longer are calls to select_idle_core() or select_idle_smt() in select_idle_sibling(). Everything got folded into one single loop in select_idle_cpu() I would be happy to pull the static branch out of select_idle_smt() and place it into this if condition, though. You are right that would save some overhead on non-smt systems. Peter, would you prefer a follow-up patch for that or a version 4 of the patch? --=20 All Rights Reversed. --=-h2yb9mmylf3PhyRBn23s Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEKR73pCCtJ5Xj3yADznnekoTE3oMFAmBsfa4ACgkQznnekoTE 3oPVdwgAknAH01IMA1aQ5Y2oSZ6UL5PULzo4l3LekWhtXcBFnpezYdxo/Ya+a2lL ykdmlvDGVyu1UL42Qi59KWb/0licduWdV35mItRg3OJrHaY7JONAJf70fqExBhYc ZTnyn0O6wsrAFJWjphOEs3Ksw1D/FsiTvUtf28gAK2F94qvyng4wDdnA2FoK/rFQ gswLeNK8hII4UPFeFMszvPwLBRvZoSE3njNRhA/Ly9INmFmfxRjIHrvciDDnGJKx Gb5KqP9zr3Xs8C1Zw2AZfSd05hdoWcKQqH99oTE7lFqbN7w5OeK427ZHGzQ2Mkrs JzqofUv0hmKMzKzYadeHavEQ8KLLOA== =IISW -----END PGP SIGNATURE----- --=-h2yb9mmylf3PhyRBn23s--