Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4440311ybp; Mon, 7 Oct 2019 08:29:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqz+IAAUKDH0gmrpvEKdr5+F9xL32K6Txa34sN86/MpR0yt6A+SfypO88rB7MWdkNdqSB02r X-Received: by 2002:aa7:cf11:: with SMTP id a17mr29476714edy.153.1570462144753; Mon, 07 Oct 2019 08:29:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570462144; cv=none; d=google.com; s=arc-20160816; b=KdMCwyxIFawksfWWROFmmsulp72L6abknVVRvj0GeltxfQDtkyNMkdCtGG3TQ6GSrd guq2/kaKRXitY52QWxSq+UgDUL5MTglNGlBCFj7vadhXDdMMg3+z9KsKIut2BmmUVXVp zIAV+Guwe5Ldp3XywQFK40pyxdNCBfVpW0IR9/EeogbtU5H6gI1jy6pug0L+TVCSI6IF KWCT8jrtL7GMPI1Sj+f2FowfYfNXdfNAJlr0/4XMpzW9LMFeV8CpzWgprHz1NLViwAXy jkeaDEq2t+8L9t3trw+gG6AaqJWNp/Jer/YsHq5u1HjlrI+Y2bIDxovBlFOS71lQR4Fk kdHQ== 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=DgooQ7bjeUKsHrGM13Xp8ZmWYyC1LW+C7CinhAKEgc8=; b=FIrbqsJCdm6hCtFs2oxgpXWv9p8zCPsEW7lOGN4uVkO/9j0ss8W8TXUwG83guc+a2B XVnOYu3cfZ8TmL5t3uuObgVoLKLtb8w3MA7o5c+/o2MX1sEV7aEn0wH0IqOKETJeB49c 6m52bLGHCXqt5PcSF5XiCuL92Y++3TsNFizk2bnKZXizjiBmuBgEaQJYq2CE7pMFvFar gLIHtYuRh5YIeK4wnEz2dq7kej62zWTwbw1qxu8ir1x1+2UBZho9P4KkrXL6MJgXBIt1 xdLW2o5QXoaaHWLzqfTzji5Bir/JPuyWrYuFOoxedVDKjZ71xFMbKuGQv0L6YSsbJJzL 6Cig== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=DTN4evx5; 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 c14si8413347edc.81.2019.10.07.08.28.41; Mon, 07 Oct 2019 08:29:04 -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=@gmail.com header.s=20161025 header.b=DTN4evx5; 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 S1728562AbfJGP2V (ORCPT + 99 others); Mon, 7 Oct 2019 11:28:21 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:35071 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726334AbfJGP2V (ORCPT ); Mon, 7 Oct 2019 11:28:21 -0400 Received: by mail-pg1-f196.google.com with SMTP id p30so6343817pgl.2 for ; Mon, 07 Oct 2019 08:28:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=DgooQ7bjeUKsHrGM13Xp8ZmWYyC1LW+C7CinhAKEgc8=; b=DTN4evx5wOGGT46g/p17877+GjTOXHG6rTtt4mF/XNNIcwxMNHcTqILMqM5TSHRq5h NLcA0jcVaoZ9GcVsWzD77lD6bSEOPyX5tF+KeqOG6DTOCVLg+IkvYkqheGCfGhiwUpgT XastpEZWvGE1kOiRNkvhD5Lc6D2imJ/46oOu+j8V7GvuigBnsbGRgk2qLV1586ahfwaI LNLHOUon3gSVSnrOybCwUmcejcU/qSsDuHaJnpVD0w1jKc4JsqGRgpw72PKzrfrWMOxb oGhzxbsXrys9bUfdiZaJnbknZ98oPboeI1eaNlkKzb5HHdWBpBJGY6t/lBP96olm6P+o MSOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=DgooQ7bjeUKsHrGM13Xp8ZmWYyC1LW+C7CinhAKEgc8=; b=jjMYJG2DBPiA6HvCWtmdDM4DALsprUsuA5GXPd1ZczZzdVQnd0NHChJ66vygVutNBn RfmQjhq5myXStmZeShhW9PSvAbPOG0SrBsOHqgAz9epq+J4N+YCDARB8Q5PIZtVcHWK5 r99F7g+WXmO/4hDOASTeKjKGDxdqKo3tzOFJWl/Ph/ReExxa7PxUeyt/ZMhioxpjykHB Lm7jE1Ik4NXZYc+SIPaUVdmJUiL0GYiHtObIZRXvM2OI25QKDyHdaTWShT4egAFNN8il btZ2BqHwk0gdfVWbkoTO3XJfRRxzoqeoR+46EdqwCHQEW9QWXppA+fHCj0DlmBB2YFQM +Ztw== X-Gm-Message-State: APjAAAU7W3B4eSAic2eOsxEuyhaybJAoANs9jPI2fnon/4YEge+ALK/s P+xGsPMixk5fuMvdc6enDsE= X-Received: by 2002:aa7:9104:: with SMTP id 4mr33694536pfh.176.1570462099386; Mon, 07 Oct 2019 08:28:19 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id w27sm17618286pfq.32.2019.10.07.08.28.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 Oct 2019 08:28:17 -0700 (PDT) Date: Mon, 7 Oct 2019 08:28:16 -0700 From: Guenter Roeck To: Matt Fleming Cc: Peter Zijlstra , linux-kernel@vger.kernel.org, Tony Luck , Rik van Riel , Suravee.Suthikulpanit@amd.com, Borislav Petkov , Thomas.Lendacky@amd.com, Mel Gorman Subject: Re: [PATCH v4 2/2] sched/topology: Improve load balancing on AMD EPYC Message-ID: <20191007152816.GA10940@roeck-us.net> References: <20190808195301.13222-1-matt@codeblueprint.co.uk> <20190808195301.13222-3-matt@codeblueprint.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190808195301.13222-3-matt@codeblueprint.co.uk> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Thu, Aug 08, 2019 at 08:53:01PM +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. > > For example, pinning 16 busy threads to NUMA nodes 0 (CPUs 0-7) and 4 > (CPUs 32-39) like so, > > $ numactl -C 0-7,32-39 ./spinner 16 > > causes all threads to fork and remain on node 0 until the active > balancer kicks in after a few seconds and forcibly moves some threads > to node 4. > > Override node_reclaim_distance for AMD Zen. > > Signed-off-by: Matt Fleming > Signed-off-by: Peter Zijlstra (Intel) > Acked-by: Mel Gorman > Cc: Suravee.Suthikulpanit@amd.com > Cc: Borislav Petkov > Cc: Thomas.Lendacky@amd.com This patch causes build errors on systems where NUMA does not depend on SMP, for example MIPS and PPC. For example, building mips:ip27_defconfig with SMP disabled results in mips-linux-ld: mm/page_alloc.o: in function `get_page_from_freelist': page_alloc.c:(.text+0x5018): undefined reference to `node_reclaim_distance' mips-linux-ld: page_alloc.c:(.text+0x5020): undefined reference to `node_reclaim_distance' mips-linux-ld: page_alloc.c:(.text+0x5028): undefined reference to `node_reclaim_distance' mips-linux-ld: page_alloc.c:(.text+0x5040): undefined reference to `node_reclaim_distance' Makefile:1074: recipe for target 'vmlinux' failed make: *** [vmlinux] Error 1 I have seen a similar problem with one of my PPC test builds. powerpc64-linux-ld: mm/page_alloc.o:(.toc+0x18): undefined reference to `node_reclaim_distance' Guenter