Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp21605543ybl; Mon, 6 Jan 2020 07:50:06 -0800 (PST) X-Google-Smtp-Source: APXvYqzARCH+exkFAsJ2IG3lvTK4MacBTZj/m1ZUK05xOyyOxXJZlgIZMadxhLmtZld6Kj/CAeGM X-Received: by 2002:a9d:12a8:: with SMTP id g37mr72151999otg.261.1578325806049; Mon, 06 Jan 2020 07:50:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578325806; cv=none; d=google.com; s=arc-20160816; b=0sj06iyk/E/8OVTPzX0WK7vv0e/PBP+HPmJqVaR2Dlp8lQ4xoPGnwMHBYUHKk0FIKO GcluA9KtyNqIndKGS8EZgK1otZRx7rulfeMNzV4ZwWQnFH6UEDlD5UfBxNMK5cHX9xig USgcRf/6gGcHwv10st5wseJeZcG4RhpAj8j6gas0GTXuA9EAuxmPIVtph9kBsO1FBPK3 mwYWMLFtxqcLFm0Duczq2WC97U2wqNHVZLmHCVmgXuVE+auOGqIbRMrtwhiI3ClZSfab O3CEVNTrncKupTfFp+g3X+G6qN0agWScVjXQdKY/UF0NVJ9e6LztrCSN4ukFWm07PPyE DsZw== 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=N7z/pGV9d0E8F5iUU/S4I4gyvSq1x3V+pdXHh430QXs=; b=szdwfSC786L4XHsNZTOO1Sc4KQnAfLTavASD7UdoqyaNj3ptjBPXfWAK9N6o872qqZ HO8Jx1kcdgpbdAmaJXOKq+cWJk/kBX+OkjaQYA45mLrzWjZOgmko5VLBWYea6QQNLOyn o5DxUd2aJVJy5xofSJXz4a32BtyiG/vAv7wJEMH/XAid2RV4v68jD3jNRbgoBib8N8dm lDlQW9QUvCWs6bmOVoiHgKguoM36ASxCEnzUxEaxuRi40wj6bNkKeCbantvSbrcpre2Q RhB16zZHicBrz0U9zVIDGMtgPdUHUHbh9DAIldrve9mF63YfQEHiTGmBAVl67yccvkPo IOeA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l20si1227957oil.224.2020.01.06.07.49.53; Mon, 06 Jan 2020 07:50:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726767AbgAFPsF (ORCPT + 99 others); Mon, 6 Jan 2020 10:48:05 -0500 Received: from shelob.surriel.com ([96.67.55.147]:39764 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726612AbgAFPsE (ORCPT ); Mon, 6 Jan 2020 10:48:04 -0500 Received: from imladris.surriel.com ([96.67.55.152]) by shelob.surriel.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1ioUbN-0004jZ-Uy; Mon, 06 Jan 2020 10:47:33 -0500 Message-ID: <04033a63f11a9c59ebd2b099355915e4e889b772.camel@surriel.com> Subject: Re: [PATCH] sched, fair: Allow a small load imbalance between low utilisation SD_NUMA domains v3 From: Rik van Riel To: Mel Gorman , Vincent Guittot Cc: Ingo Molnar , Peter Zijlstra , pauld@redhat.com, valentin.schneider@arm.com, srikar@linux.vnet.ibm.com, quentin.perret@arm.com, dietmar.eggemann@arm.com, Morten.Rasmussen@arm.com, hdanton@sina.com, parth@linux.ibm.com, LKML Date: Mon, 06 Jan 2020 10:47:18 -0500 In-Reply-To: <20200106144250.GA3466@techsingularity.net> References: <20200106144250.GA3466@techsingularity.net> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-XpltXy3SHHbmr7nTgcUV" User-Agent: Evolution 3.34.2 (3.34.2-1.fc31) MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-XpltXy3SHHbmr7nTgcUV Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2020-01-06 at 14:42 +0000, Mel Gorman wrote: >=20 > + > + /* Consider allowing a small imbalance between NUMA > groups */ > + if (env->sd->flags & SD_NUMA) { > + long imbalance_adj, imbalance_max; > + > + /* > + * imbalance_adj is the allowable degree of > imbalance > + * to exist between two NUMA domains. > imbalance_pct > + * is used to estimate the number of active > tasks > + * needed before memory bandwidth may be as > important > + * as memory locality. > + */ > + imbalance_adj =3D (100 / (env->sd->imbalance_pct > - 100)) - 1; > + > + /* > + * Allow small imbalances when the busiest > group has > + * low utilisation. > + */ > + imbalance_max =3D imbalance_adj << 1; > + if (busiest->sum_nr_running < imbalance_max) > + env->imbalance -=3D min(env->imbalance, > imbalance_adj); > + } > + Wait, so imbalance_max is a function only of env->sd->imbalance_pct, and it gets compared against busiest->sum_nr_running, which is related to the number of CPUs in the node? Lets see how this works out for different numbers of CPUs in each node. With imbalance_pct =3D=3D 115, we end up with=20 imbalance_adj =3D (100 / (115 - 100)) - 1 =3D 0.18, which gets rounded down to 0. Wait, never mind the different numbers of CPUs. Am I overlooking something, or did you mean to have a factor of number of CPUs in the imbalance_adj calculation? kind regards, Rik --=20 All Rights Reversed. --=-XpltXy3SHHbmr7nTgcUV Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEKR73pCCtJ5Xj3yADznnekoTE3oMFAl4TVoYACgkQznnekoTE 3oO5jggAuwBm1TeNZZs6lr/gw6VXGYhwcDrj2jR/XCVM1gStkxH7jbCC70zYWZVS rUepu2W6da/d96+wtwjgXQ34zGy7Gwg+hWZ7d13Cv4+xk2YtXzpsG/1Nrn2hMpYt zdBwdf0xSF8PKLmuK6PM1dIHZkVKnuvVcqLfCkW4dBFnZixw4Srdi6kD709xQuJF S9rAzxFVFdIxfhEm8oYYT4aVkEtFLVME/bzVpmBbtIlOBGJzYpnIrhZFOgv9FDgi D2HCJg18d2bqGu/z/U6nEN6dPl18KFh2IA8niW7dutIAGbpwr3CTDRTQe6QElzqP 037MA6M7nCsJo9Bj7QpKKArznPks4g== =ew2e -----END PGP SIGNATURE----- --=-XpltXy3SHHbmr7nTgcUV--