Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7090113ybi; Wed, 5 Jun 2019 11:02:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqxGe/Ban6EyShR6oxKhlOf6hgF9J/YFVILkGsaGmyi6uK+Otz2ZQU8htjAmJ8/UYgJBf5uF X-Received: by 2002:a63:49:: with SMTP id 70mr6374676pga.163.1559757761185; Wed, 05 Jun 2019 11:02:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559757761; cv=none; d=google.com; s=arc-20160816; b=NieeXmYDttOcsF7ISc77FNanVkgXIT2aE3UC/LFcChZUo7kAT0ZvayvYoe6l6SRSI5 8OqYsi6VZ9iO+ax/uhWNBUZApYWTNJ7MmCOuv+HyyKj6jv+a/2qPEBFGIU2f43zSGq8o E+4KjJL/kk4X51lVP+q8gRj6lR9zDgyQj2nhPbNx2a8sTHnn6EFf4X+TElnWF1eF9/DT LhGIQ8vp3bguCOf5H8xQmqDTijGVBiFfc916JEgXcQ5zaYHe7T2G3Y87NF2QIqGeS6yN lue2+9THfo/haNLgGNto4RTWkbt0X4DdDES6juLCiGfI4RzsI8EfzPDU7rkXOGRx8i6x XSig== 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:dkim-signature; bh=Wn6hbzD6Cf/LprvMetYQYPui1bmuJTeex+C2j3IFqVU=; b=ltsnkPR5rAwzWlz5I1YSwpMPqZHJsUA6PpAd9EDciyM72IwsF7msu95jL269YSTpz0 /nF+gTa10BV3jroFftv+l9l2QHur9mO2kGH9tzkR6MPT7qiHJV9eW5ETuU6N5QgxfIr3 UwD8CLvMbif2YKZyD1afjWzf1q6Yi5OummlyqEJBHLVOKPj3R9kx5S/14kFmbcr1DQe+ V8kehD5LSnHWNeWFxlhBz2t87fGRXYedJvoNUAJ6wUhcK6sgbjBtK1tEJsIj18BJk/LE 39k2e2Fh6SdKS3so671ee/37daJvnUBn9OxQ2zyvinqEmguEIBqZW3R7Ene1N7EW0cM8 6efw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=HL94Of1Q; 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 s4si27300765pji.88.2019.06.05.11.02.22; Wed, 05 Jun 2019 11:02:41 -0700 (PDT) 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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=HL94Of1Q; 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 S1726608AbfFESAr (ORCPT + 99 others); Wed, 5 Jun 2019 14:00:47 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:53512 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726572AbfFESAr (ORCPT ); Wed, 5 Jun 2019 14:00:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Wn6hbzD6Cf/LprvMetYQYPui1bmuJTeex+C2j3IFqVU=; b=HL94Of1QKtkxZTpCwABGGooa2 XVtrsEMGwalwBX4XvOYCkNFLP/qupgDioPE+hDpSpdN204B2YSqRktmqd72nW74hbAm5TnqQ6Tvly 4DMFCm8MQ9/jxMLEFiQdbsZ9XDbnlZQ5lHvcdDgr90MzrpPpRK9vX4nyN2tALYuk6XH2l8aD9TrQZ yHes24OdR1TEGKiIjZpy8nqCk12U/IJdvKQkUGdQKqv5+1b0FI1ifdQfTED6SqVZGZKxaM8Qbf4bL jSy7yomC6xbFtFkoggx752leMhrLyGqlQgWR31onRoREpKtj87gwwqUucSQHTQCXuRDEQKEVD2w72 WS3kzOndw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hYaDG-0001Km-5b; Wed, 05 Jun 2019 18:00:38 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id F242220757B40; Wed, 5 Jun 2019 20:00:35 +0200 (CEST) Date: Wed, 5 Jun 2019 20:00:35 +0200 From: Peter Zijlstra To: Matt Fleming Cc: linux-kernel@vger.kernel.org, "Suthikulpanit, Suravee" , Mel Gorman , "Lendacky, Thomas" , Borislav Petkov Subject: Re: [PATCH] sched/topology: Improve load balancing on AMD EPYC Message-ID: <20190605180035.GA3402@hirez.programming.kicks-ass.net> References: <20190605155922.17153-1-matt@codeblueprint.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190605155922.17153-1-matt@codeblueprint.co.uk> 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 Wed, Jun 05, 2019 at 04:59:22PM +0100, Matt Fleming wrote: > SD_BALANCE_{FORK,EXEC} and SD_WAKE_AFFINE are stripped in sd_init() > for any sched domains with a NUMA distance greater than 2 hops > (RECLAIM_DISTANCE). The idea being that it's expensive to balance > across domains that far apart. > > However, as is rather unfortunately explained in > > commit 32e45ff43eaf ("mm: increase RECLAIM_DISTANCE to 30") > > the value for RECLAIM_DISTANCE is based on node distance tables from > 2011-era hardware. > > Current AMD EPYC machines have the following NUMA node distances: > > node distances: > node 0 1 2 3 4 5 6 7 > 0: 10 16 16 16 32 32 32 32 > 1: 16 10 16 16 32 32 32 32 > 2: 16 16 10 16 32 32 32 32 > 3: 16 16 16 10 32 32 32 32 > 4: 32 32 32 32 10 16 16 16 > 5: 32 32 32 32 16 10 16 16 > 6: 32 32 32 32 16 16 10 16 > 7: 32 32 32 32 16 16 16 10 > > where 2 hops is 32. > > The result is that the scheduler fails to load balance properly across > NUMA nodes on different sockets -- 2 hops apart. > > Update the code in sd_init() to account for modern node distances, and > maintaining backward-compatible behaviour by respecting > RECLAIM_DISTANCE for distances more than 2 hops. And then we had two magic values :/ Should we not 'fix' RECLAIM_DISTANCE for EPYC or something? Because surely, if we want to load-balance agressively over 30, then so too should we do node_reclaim() I'm thikning.