Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp437841pxx; Mon, 26 Oct 2020 11:55:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsSFPAK7hy16GAJqfQ5rvxZXL6xI2ozx0cIhBj442SnRZGnPKra3UzFmsbN9HB4ZnhZaih X-Received: by 2002:a17:906:7c4b:: with SMTP id g11mr17581185ejp.469.1603738507633; Mon, 26 Oct 2020 11:55:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603738507; cv=none; d=google.com; s=arc-20160816; b=cuoMfaqX10M/qUoGhg5507YD0YM+sPLgJ7lADCHtgGufVIaEP4X7e0ySponQgZWEMo aN1u1YmrAPVx1lCfzI9UWMZYjIX6t/7E+a4zwoKmLD3QfaUkUFKF44rs/Ii0PDgO7e/V zlkdMNcBO2q5xOwXFRXQ3wDAZVZr73fV+lyxRVbHY9wZThgUVIDFx59XvOT34GhbLd3p fbiKZFWzi24Y2aRoUB0Rgp4G8zIWqdJqP115/RomByOJCw7xqUiaBgS8FRZl+C1JVEbI w8Dxo56CRtBiRu9oK58Z1tStb7CroaXk0/E+ibxRdvyMYeb3K7lFbgfsFSKmrDArNjtd FP7A== 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=rRvgdgHQcEAj9z8m2f3IP1zHbzRcf5CJJ+j8SRewjow=; b=gCMV6oafDTrrAtPM4JeqYaDh03ELuA8wpVHXxsgsTMsGFi5UD3ZkC0gJd/JP1Xf+nB oiO/yyb7HLGTd6CwmJkpy+Rc7gzRgFDa7/Sess0W+SUPCvIbC6fvBx/fLafxvY5On6GR bWifvfNXQqStrVCygZFIMjQIFwaTnKpcqERrpbn/RAEz2PXCXa2+3gBwuKAoEU1tdyeH ggzekymThDrryQ8attlBDXFSc793YC6CpDROc3dZCQMrN46osxIWrCFy68zCEA7qFSQo 3rwa8ssbyIaPECuumovAlR+udEhBjmCTAPpzEMNi7ELTyZ+ezY8gzxYxfj8qEC8Eo7el HThw== 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 g4si7590860ejw.351.2020.10.26.11.54.45; Mon, 26 Oct 2020 11:55:07 -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 S1783044AbgJZPEr (ORCPT + 99 others); Mon, 26 Oct 2020 11:04:47 -0400 Received: from shelob.surriel.com ([96.67.55.147]:55400 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1782998AbgJZPEo (ORCPT ); Mon, 26 Oct 2020 11:04:44 -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 1kX437-0003c0-HP; Mon, 26 Oct 2020 11:04:41 -0400 Message-ID: <334f491d2887a6ed7c5347d5125412849feb8a0a.camel@surriel.com> Subject: Re: [PATCH] fix scheduler regression from "sched/fair: Rework load_balance()" From: Rik van Riel To: Vincent Guittot Cc: Chris Mason , Peter Zijlstra , Johannes Weiner , linux-kernel Date: Mon, 26 Oct 2020 11:04:40 -0400 In-Reply-To: References: <0014CA62-A632-495A-92B0-4B14C8CA193C@fb.com> <20201026142455.GA13495@vingu-book> <465597a2250d69346cff73dd07817794d3e80244.camel@surriel.com> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-uoSqbbpvT8hC+tuw0JPB" 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 --=-uoSqbbpvT8hC+tuw0JPB Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2020-10-26 at 15:56 +0100, Vincent Guittot wrote: > On Mon, 26 Oct 2020 at 15:38, Rik van Riel wrote: > > On Mon, 2020-10-26 at 15:24 +0100, Vincent Guittot wrote: > > > Le lundi 26 oct. 2020 =C3=A0 08:45:27 (-0400), Chris Mason a =C3=A9cr= it : > > > > On 26 Oct 2020, at 4:39, Vincent Guittot wrote: > > > >=20 > > > > > Hi Chris > > > > >=20 > > > > > On Sat, 24 Oct 2020 at 01:49, Chris Mason wrote: > > > > > > Hi everyone, > > > > > >=20 > > > > > > We=E2=80=99re validating a new kernel in the fleet, and compare= d > > > > > > with > > > > > > v5.2, > > > > >=20 > > > > > Which version are you using ? > > > > > several improvements have been added since v5.5 and the > > > > > rework of > > > > > load_balance > > > >=20 > > > > We=E2=80=99re validating v5.6, but all of the numbers referenced in > > > > this > > > > patch are > > > > against v5.9. I usually try to back port my way to victory on > > > > this > > > > kind of > > > > thing, but mainline seems to behave exactly the same as > > > > 0b0695f2b34a wrt > > > > this benchmark. > > >=20 > > > ok. Thanks for the confirmation > > >=20 > > > I have been able to reproduce the problem on my setup. > > >=20 > > > Could you try the fix below ? > > >=20 > > > --- a/kernel/sched/fair.c > > > +++ b/kernel/sched/fair.c > > > @@ -9049,7 +9049,8 @@ static inline void > > > calculate_imbalance(struct > > > lb_env *env, struct sd_lb_stats *s > > > * emptying busiest. > > > */ > > > if (local->group_type =3D=3D group_has_spare) { > > > - if (busiest->group_type > group_fully_busy) { > > > + if ((busiest->group_type > group_fully_busy) && > > > + (busiest->group_weight > 1)) { > > > /* > > > * If busiest is overloaded, try to fill > > > spare > > > * capacity. This might end up creating > > > spare > > > capacity > > >=20 > > >=20 > > > When we calculate an imbalance at te smallest level, ie between > > > CPUs > > > (group_weight =3D=3D 1), > > > we should try to spread tasks on cpus instead of trying to fill > > > spare > > > capacity. > >=20 > > Should we also spread tasks when balancing between > > multi-threaded CPU cores on the same socket? >=20 > My explanation is probably misleading. In fact we already try to > spread tasks. we just use spare capacity instead of nr_running when > there is more than 1 CPU in the group and the group is overloaded. > Using spare capacity is a bit more conservative because it tries to > not pull more utilization than spare capacity Could utilization estimates be off, either lagging or simply having a wrong estimate for a task, resulting in no task getting pulled sometimes, while doing a migrate_task imbalance always moves over something? Within an LLC we might not need to worry too much about spare capacity, considering select_idle_sibling=20 doesn't give a hoot about capacity, either. --=20 All Rights Reversed. --=-uoSqbbpvT8hC+tuw0JPB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEKR73pCCtJ5Xj3yADznnekoTE3oMFAl+W5YgACgkQznnekoTE 3oNlGAgAtkGVNBd2a9XHIag/z/SA4HsBvh9aBDgkRFVq/c+5d6rO2Lg8cOYEU6hm oFcZDlMEXGXNPLa8MBsAEsDqY8r8kz/pjpFSjLk81oeodMpKM2ZUAwacmTXfvgfL 9ZzYiuU6wKQVs1n78KTS15aRLd/1K1NLTR+kqW44Gi6UkWmV85YjqCagI8l2HbnB VXxaLsiLVhMtd0dOFGZybKYpllrehaG18Jszeli8xzDm80DQ88a+L91g79mLAbxS pfXc8x1rhw+J4dMwCJq185oT9qxcblANRH1lYrxZQV9xENdRPAMCpxjIar/T8jVK NzSVEs3ZUvNHSityHaXdURJEg2/fTA== =0/4b -----END PGP SIGNATURE----- --=-uoSqbbpvT8hC+tuw0JPB--