Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp22358027ybl; Tue, 7 Jan 2020 00:45:39 -0800 (PST) X-Google-Smtp-Source: APXvYqy4S/mVtzvaXQFUvaEbSmhU+kZDhdMJPdjGvYO/pR5iI6tb/3Kh117Eg24SgfQOHY4dH8mp X-Received: by 2002:a05:6830:1487:: with SMTP id s7mr95352692otq.269.1578386739525; Tue, 07 Jan 2020 00:45:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578386739; cv=none; d=google.com; s=arc-20160816; b=hi7LjIc7x5SMXAGhx4Uonr3zoT81eMga9l9FVI+YkLPkENp+2BqqDfAPBH8aaYpDlm PJ7WMdgB8GXEVKc9++alHBErhehpI9TcrwEMT/BuYgke+IKbigGnDKYi4/lVY75/Qyxa wZnDCNTK3Gsr1nbPqWn5fvdfCFwBBS0LCh9wzqNm7SqSBEVR+KG4KOME0F0FeAok4UAy U1O8oZBigD0votDjSM+8khF1nXwrSTkWIwKP4Wb3qFK3p6nGCpazNY76SFfYZuJX4L2v Qu/+CkZ0ynQ9UjwpPmqoGTK2JeOcF6j8k8FYng0dDNHW/so/gbozsoKphpnJTIlUmej4 HeMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=aCHTLlvSSFUfmz+CkuEE+w2aqN9hLb1R9/51NebftNY=; b=zeXIXKDez3xe+xx+/0nHlVhllVU7dmBikC9f0e0rI90gKoXLP0shxtmoPM42cKNAQ6 boIJOzpd4r84r1j0tTc8uxKbx0U4bxv6Ig5irZ3Svi5zTJedblPTb/CKDqUDqLkvKv6M MHgmzxMfye6+cdMa+X1eCtjP1lv92QvK7L2eHAqe+9MsrWRvgRU53DTurRtI7VQ3SU4j /8tC9Lyrv5F52xq4/64UPeBFPM79ilBS1sUMT2cGgeJuvdpr6HjfipfRdtAqr4WxqrMp 3klo8EcNYzTMlF8JIfytv3N15Cw29NVeTyn/KjkeLL6Y7JmK4pbubuq8N56efuAdChye sKIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QI0EPnZS; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w196si31747900oia.135.2020.01.07.00.45.25; Tue, 07 Jan 2020 00:45:39 -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; dkim=pass header.i=@linaro.org header.s=google header.b=QI0EPnZS; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727273AbgAGIoh (ORCPT + 99 others); Tue, 7 Jan 2020 03:44:37 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:43154 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726327AbgAGIoh (ORCPT ); Tue, 7 Jan 2020 03:44:37 -0500 Received: by mail-lj1-f194.google.com with SMTP id a13so53820964ljm.10 for ; Tue, 07 Jan 2020 00:44:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aCHTLlvSSFUfmz+CkuEE+w2aqN9hLb1R9/51NebftNY=; b=QI0EPnZSXZ0Fjqfn7lDbNP3A6Xp3IxHa848tS4/Pq3C6ER+Il/zU93St0jmV+MjG7e m1Pz5iIGkWELOwQjmhEd8y6zaWQxX9n90zTiv2hhDUqdIQ6T7QDu6X+Bs/bVTbWms6N/ kLsaGsVIeiWC3YqEXt41Bc6SgbZdNJUiLaW0l4pBn0QQ74EihwG8QLazikqhx65+GJOQ bs7WpqhJ+9D1SwX8UXOMdSttWU0cLKS3wchLa2fTZOcEc1Q5FNfANZzEzx5FYLFlqCFc hemw5jWmN+06OpT2mE7t6qYGJP6B2hzAWwBqchXGddcKC2x0v/9rPuUQt+n7NP5X586n 9Eng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aCHTLlvSSFUfmz+CkuEE+w2aqN9hLb1R9/51NebftNY=; b=BvBaEKkZASRzC+ne/zX1jibqvvV300cSBIuxP8zzK76LSrMyaKdgJ1VZca5mzts12W lbdaYWw4/fY24OErm5xqMV2OgEPX6HdwGRNnYo8ELdpiLFFTugSIeDQmovJdUL6YhY2y 8Pa+0z8OyTYIAjT496KeekMOa/Uak7iTVVJZ7vqEnmpGFoSyLT0shwTOtD0snAQlXxEZ PNXe4kE2NzywxNrU4yDRKzRh6tMUowi4fFPsjJNHoGX74nh6y6ONjEflMnckxBfrw15z ++nj5ffKMVoftmDzmnZl8eyV+ohNgsSibjhRJAYjzQypneQonOSyFY7rcZsEVBjSM1P2 yF/Q== X-Gm-Message-State: APjAAAU02CvoUVhWO/vcFLLw8YsDW7FaYn7IJppZ8G78QJ+qVey1fOYk 5ferNKCcPWy6TYmvF1l42vSXIR5xJNaMOeQORKjv0Q== X-Received: by 2002:a2e:9b03:: with SMTP id u3mr52699558lji.87.1578386674763; Tue, 07 Jan 2020 00:44:34 -0800 (PST) MIME-Version: 1.0 References: <20200106144250.GA3466@techsingularity.net> <04033a63f11a9c59ebd2b099355915e4e889b772.camel@surriel.com> <20200106163303.GC3466@techsingularity.net> <20200107015111.4836-1-hdanton@sina.com> In-Reply-To: <20200107015111.4836-1-hdanton@sina.com> From: Vincent Guittot Date: Tue, 7 Jan 2020 09:44:23 +0100 Message-ID: Subject: Re: [PATCH] sched, fair: Allow a small load imbalance between low utilisation SD_NUMA domains v3 To: Hillf Danton Cc: Rik van Riel , Mel Gorman , Ingo Molnar , Peter Zijlstra , Phil Auld , Valentin Schneider , Srikar Dronamraju , Quentin Perret , Dietmar Eggemann , Morten Rasmussen , Parth Shah , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 7 Jan 2020 at 02:51, 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); I agree that we should take into account the size or the utilization of the node in some way > > 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; A similar test has already been done in fbg and we call calculate imbalance only if busiest is busier than local > > with imbalance_pct taken into account. > > Hillf >