Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp21692312ybl; Mon, 6 Jan 2020 09:20:23 -0800 (PST) X-Google-Smtp-Source: APXvYqzD/t7ErzL8Qrw4rYOo3HGno1vNvtITbQZ2dq8tOmlY1ZHyZaDUKsNASGh2rgx+Qnon29gS X-Received: by 2002:aca:c493:: with SMTP id u141mr6111941oif.62.1578331223604; Mon, 06 Jan 2020 09:20:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578331223; cv=none; d=google.com; s=arc-20160816; b=mbZvEOW6Si1h6bBQ9NjU3h6OQlglwUCCH4Rt2ceNxSbLwrjDz4mONSisFOOjk+WypT sYdf42/lujxXvfXD8kO1xrz2gHgHfn6dpibC77aoDDk5c9i58abd6t1yc1g/b6L3GNg9 L3/qhuyrYHRWrpjXHLz7nflvwgADCisYYfxRxikUlLy0hDKTu8fwBQq9uJvlkWZFH+t0 geJ4eXzNwSVM6TsrB7qr52+5HE/cLkJphxwL+cXym4PTQ5NvyBCpIEiwqksKUXGZx7Mr mOQqeve9NoBplPzcMqXVqfrMKRbit6r8imoRZ5705eA8qqIeuNgDbp74rmObhHt4o+eH uM8w== 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=XQz/5KIdNj2JSW+fXj0p0mJYuXwXVAjaWOIWIsUpCz8=; b=KfsIutuXCiOOITCE7sWiTSQvVujnEVnCNc1uEB/PaJlFh9V8frRl7QQGdTL3JD1FMc U5XfY+9C/sWnaWUdqg2WLDdwot6X6RdynCf5M5BqdgJDIok+pjE1r3PbExVFdkYY5/62 AG3I0/8hh0rJk4R/kOE1mk4qXvoJfuyWdMRNTxACGfMBjIY3GI5fTachIBvyUKUDa99b 9ACHEpk6piFPWmhe6V7Imf8gSm3cOq9q3QJE47FuVftCSeBjuBYFkXnWyZAcHibmVJ55 BBw02h+3MijCK4hyvJ6unv1h5o/feH9Q2Mdq7sKX0lsleq98opUoiS6bU/0qFoT4/jiM 9vpw== 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 y24si31299488oih.24.2020.01.06.09.20.11; Mon, 06 Jan 2020 09:20:23 -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 S1726683AbgAFRTX (ORCPT + 99 others); Mon, 6 Jan 2020 12:19:23 -0500 Received: from outbound-smtp07.blacknight.com ([46.22.139.12]:52074 "EHLO outbound-smtp07.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726526AbgAFRTX (ORCPT ); Mon, 6 Jan 2020 12:19:23 -0500 Received: from mail.blacknight.com (pemlinmail05.blacknight.ie [81.17.254.26]) by outbound-smtp07.blacknight.com (Postfix) with ESMTPS id C7BE61C2923 for ; Mon, 6 Jan 2020 17:19:20 +0000 (GMT) Received: (qmail 5145 invoked from network); 6 Jan 2020 17:19:20 -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); 6 Jan 2020 17:19:20 -0000 Date: Mon, 6 Jan 2020 17:19:18 +0000 From: Mel Gorman To: Rik van Riel Cc: 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, hdanton@sina.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: <20200106171918.GD3466@techsingularity.net> References: <20200106144250.GA3466@techsingularity.net> <04033a63f11a9c59ebd2b099355915e4e889b772.camel@surriel.com> <20200106163303.GC3466@techsingularity.net> <03ad3a0a1d8e84c12ad958e291040a32a49c9f0f.camel@surriel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <03ad3a0a1d8e84c12ad958e291040a32a49c9f0f.camel@surriel.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 Mon, Jan 06, 2020 at 11:44:57AM -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. > True but while imbalance_pct has the possibility of being something other than 125 for SD_NUMA, I'm not aware of a case where it happens. If/when it does, it would be worth reconsidering the threshold. > 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). Yes, it's there for a reason. The intent is to only allow the imbalance for low utilisation. Too many corner cases were hit otherwise -- utilisation near a nodes capacity, highly parallelised workloads wanting to balance as quickly as possible etc. In this version, the only case that really is being handled is one where the utilisation of a NUMA machine is low which happens often enough to be interesting. -- Mel Gorman SUSE Labs