Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp19151ybl; Tue, 7 Jan 2020 01:14:20 -0800 (PST) X-Google-Smtp-Source: APXvYqzWOejAnTuNV2q2wVw3Ye7H3MO6cuMnDYq2ODyU9VxcIa4DuRv9qPyuvbnl8YfauxLJC4gD X-Received: by 2002:a9d:6314:: with SMTP id q20mr11030124otk.3.1578388460000; Tue, 07 Jan 2020 01:14:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578388459; cv=none; d=google.com; s=arc-20160816; b=AqFsDhkUGVdGXmRYHCGuZHiC4z7MiJckcvqEiRblS8AF+0aHl2FN3ANrIYamEepwSJ l664dLILi3Nb2u37H5QdW5Al+fdB8akMwu5lj6r4bF3Lf95ZXcbxeYW5frfPT8PEKKaD OTOZ5P9iovPNsF1PLm9TotaSF1EqXZXlseqjT3bAlUi6j0zXk/bME2k9PEaLzm/63Ayx wtW/JY806yPQSG5BjDqX6B+0gacAmoP4fc8VkbaYMYJXXx6/t850MeCRJux9viCzRyo8 FltJaDf3+3R4D7/g1pW0GuiuryKzTzatU2hEkdT/9h78Uc3k8xuKlVrqYz2cHB8cH0kz 6v+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=jL5VHnnag68cqTcmB+908TTy01DwON9ujaqeDwtgmHA=; b=zF2IyJRNUD057oDgV7TYsXHK5gSVB9BAt8ChnJykmuanBgIIy00fR4tpvUcnZsIkm3 0Zj0HGkSOFxHG1gkT7K8c8XFPqOmGqp2qmRsP9PwuQCjpjtXuxbDr8nb/oCpsWsqftHx v/rK6O372AYWbPXMUxNEjoos9Jy3rQus7/OLCY4AIoC2IisTOVVF6QcxO8FIvBYs6Eo2 BzNtrMegcoECmpHob5nB3ZMlxAyFPV9WXDNIJxHcXMQpCQKgdmuP+g0pFleCfeZldRuB XgYAtHDTyStdaUoGK+x3Y3Uqc+AQW6OSD3OS0o/LmHgXe+np8TkX0Ie5m4PDe93p/vZU TFxw== 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 u62si29863122oig.29.2020.01.07.01.14.07; Tue, 07 Jan 2020 01:14:19 -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 S1727664AbgAGJNA (ORCPT + 99 others); Tue, 7 Jan 2020 04:13:00 -0500 Received: from outbound-smtp14.blacknight.com ([46.22.139.231]:39253 "EHLO outbound-smtp14.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726327AbgAGJNA (ORCPT ); Tue, 7 Jan 2020 04:13:00 -0500 Received: from mail.blacknight.com (unknown [81.17.254.26]) by outbound-smtp14.blacknight.com (Postfix) with ESMTPS id 8C6D61C2D11 for ; Tue, 7 Jan 2020 09:12:58 +0000 (GMT) Received: (qmail 21528 invoked from network); 7 Jan 2020 09:12:58 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.18.57]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 7 Jan 2020 09:12:58 -0000 Date: Tue, 7 Jan 2020 09:12:56 +0000 From: Mel Gorman To: Hillf Danton Cc: Rik van Riel , Vincent Guittot , 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, parth@linux.ibm.com, LKML Subject: Re: [PATCH] sched, fair: Allow a small load imbalance between low utilisation SD_NUMA domains v3 Message-ID: <20200107091256.GE3466@techsingularity.net> References: <20200106144250.GA3466@techsingularity.net> <04033a63f11a9c59ebd2b099355915e4e889b772.camel@surriel.com> <20200106163303.GC3466@techsingularity.net> <20200107015111.4836-1-hdanton@sina.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20200107015111.4836-1-hdanton@sina.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 07, 2020 at 09:51:11AM +0800, Hillf Danton wrote: > > Hi Folks > > On Mon, 06 Jan 2020 11:44:57 -0500 Rik van Riel wrote: > > On Mon, 2020-01-06 at 16:33 +0000, Mel Gorman wrote: > > > On Mon, Jan 06, 2020 at 10:47:18AM -0500, Rik van Riel wrote: > > > > > + imbalance_adj = (100 / (env->sd->imbalance_pct - 100)) - 1; > > > > > + > > > > > + /* > > > > > + * Allow small imbalances when the busiest group has > > > > > + * low utilisation. > > > > > + */ > > > > > + imbalance_max = imbalance_adj << 1; > > > > > + if (busiest->sum_nr_running < imbalance_max) > > > > > + env->imbalance -= 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? > > > > > > > > > > It's not directly related to the number of CPUs in the node. Are you > > > thinking of busiest->group_weight? > > > > I am, because as it is right now that if condition > > looks like it might never be true for imbalance_pct 115. > > > > Presumably you put that check there for a reason, and > > would like it to trigger when the amount by which a node > > is busy is less than 2 * (imbalance_pct - 100). > > > If three per cent can make any sense in helping determine utilisation > low then the busy load has to meet > > busiest->sum_nr_running < max(3, cpus in the node / 32); > Why 3% and why would the low utilisation cut-off depend on the number of CPUs in the node? That simply means that the cut-off scales to machine size and does not take into account any consideration between local memory latency and memory bandwidth. > And we can't skip pulling tasks from a numa node without comparing it > to the local load > > local->sum_nr_running * env->sd->imbalance_pct < > busiest->sum_nr_running * 100; > > with imbalance_pct taken into account. > Again, why? In this context, an imbalance has already been calculated and whether based on running tasks or idle CPUs, it's not a negative number. The imbalance_adj used as already accounted for imbalance_pct albeit not as a ratio as it's normally used. -- Mel Gorman SUSE Labs