Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2482823ybt; Fri, 3 Jul 2020 10:08:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUU7lLp161uFc90qcmfKI6M1Xsfu/4HwgXu3i5Y3v11Qe8PvMaqtwj38vU1K4A4nGC+6a2 X-Received: by 2002:aa7:d845:: with SMTP id f5mr40783377eds.162.1593796113063; Fri, 03 Jul 2020 10:08:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593796113; cv=none; d=google.com; s=arc-20160816; b=tDk/wSGmaPoPgyunBQoHWGGtB+vXWxNVYgu8AoKhZJp1rZSMKAoNk2QvvOOulsfXFl /qnL9Bzla3TjH9sjxa3mt0cd/SryJ2A+ye+jKEta04fM1KbstbLhoThwrDIIkkuCQ0B6 MrxWWNJV4Vy4CJemMg5/504o+1t9PAtQyHwfF/r3tM2qlHo6pp9t47sW+XGKCBc3QvIW 28gYUMrRYFhwdZNWXiusbl9MaZJ9sY5q/tuI95dyWJubTgrBa1skAHt7tnvwLM07z+2c FRZYhZVh88pNF5WRsWgjcid8cB9f6xgZ/AQt2p+MKUFjXavrYA4GDJoxadtHP4zRO+X4 X6Qw== 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=NGIWYGclw9/se36iCMUa3R+SNfFXJ4xJXXtTXZwYe78=; b=QPXNdJ4iJUuMNs6DlYdfh5S3DkRlZoUEDz8ZiFXgI9JcBHAPvqamzt2zbNF5Rz5DTK kds8/it0aysOkx8XOEpKgxJXmj+IXuRAa89lOTx+/Q+dbB2VGYJBCiLjELcOJxoBMM60 7O/aG/9HlnVU7oxbH838gb9umwDKpMzHQ//gaobeFW/tURJQBpJvWQa/+uvhg4VGfwIb yvcVtkUNdGLzlyJkflp3lNFqNsu8ZTaDS7mkLZkRI0Gp7L8HFfNCrO3S9b6tZYbIB8m3 oEnfggRt4PKqDWyThTJ3hrIu6B4FmVJoIhMv2JJ7s5H3KOJmjLoPZcs9VjS4L+O5joye 2hvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=lQwRKFro; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i23si7960868eds.82.2020.07.03.10.08.10; Fri, 03 Jul 2020 10:08:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=lQwRKFro; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726734AbgGCRIH (ORCPT + 99 others); Fri, 3 Jul 2020 13:08:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726632AbgGCRIH (ORCPT ); Fri, 3 Jul 2020 13:08:07 -0400 Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3D6CC061794 for ; Fri, 3 Jul 2020 10:08:06 -0700 (PDT) Received: by mail-lf1-x142.google.com with SMTP id k17so6106786lfg.3 for ; Fri, 03 Jul 2020 10:08:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NGIWYGclw9/se36iCMUa3R+SNfFXJ4xJXXtTXZwYe78=; b=lQwRKFroLLPm5QHChkg3JAbf09EtECvI6zfs4GvXqOv6vnLW7/Wzd13wD75qKSfnz7 W1oWm4sqRuHKPH1SdI5iJKGlkA0Xb2bvhBW7TZtX2L6BQcz3N0aW1yF8wULQzZlIztY4 7kjf7CwY4DS9N6TgXcRNaWIPTwxbCA1zxLgfB1vgO8Xf7Au25qL7io068STZgVpzTVlj B2xlQGLVq9WMVnXwtAuwrqoZcn+ghylFGdG243Z7HRbA1YBhwJXVFclBTU65JPHo3c8y ZJHiY2rY+ftttiBN6+jSkr3vdfkeY6y2ljaNxxWUyu5GeAP4NrTT/+E6zuHuGWzPstxj 1bIg== 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=NGIWYGclw9/se36iCMUa3R+SNfFXJ4xJXXtTXZwYe78=; b=NOYWgJCpMm4OodNw+jVV338kHNmBSNPy/Y118zCEd1HLs2+ERcJm1vnTjXQebCK22b 8IIYt2xehCfxpXXVfL6iYDeZGzyU38nT2DinuroqA9ct0FbtK9D0vcjQhRfY8FIL1LSk dh1/ESQqib4AJPR9wbCyhF/WBxQrMUByPbg5PRbOWF6MIzsrEQTpC3Jxt1B4kII4LhTH vqlGM3vAOaqcG9BZ8EevoOMlbf+8XORceDkmsJk3mBv6FI9VeC8IqpI7y3gWDpKZyLV1 0oyyoaJRJlOvdNDH+SzWV51wd0wBxB4gdk5aQEPwhzxg/36xNthjQgTEJb2Vfg6yf9n0 tA5A== X-Gm-Message-State: AOAM532GfDPkZPfNMARya24VPJ3JoNS0k5HRmt0QpPJBPkEqutT2Klt8 Agf4g3Yv0OkCFHssgHS2ZRSdGIYi8k5WKUw0/Q== X-Received: by 2002:ac2:5443:: with SMTP id d3mr22423704lfn.121.1593796085271; Fri, 03 Jul 2020 10:08:05 -0700 (PDT) MIME-Version: 1.0 References: <20200703155749.GA6255@pc636> In-Reply-To: <20200703155749.GA6255@pc636> From: Gabriel C Date: Fri, 3 Jul 2020 19:07:39 +0200 Message-ID: Subject: Re: nr_cpu_ids vs AMD 3970x(32 physical CPUs) To: Uladzislau Rezki Cc: LKML , linux-mm@kvack.org, Andrew Morton , Linus Torvalds , GregKroah-Hartmangregkh@linuxfoundation.org, "Peter Zijlstra (Intel)" 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 Am Fr., 3. Juli 2020 um 17:58 Uhr schrieb Uladzislau Rezki : > > Hello, folk. Hello, > > I have a system based on AMD 3970x CPUs. It has 32 physical cores > and 64 threads. It seems that "nr_cpu_ids" variable is not correctly > set on latest 5.8-rc3 kernel. Please have a look below on dmesg output: > > > urezki@pc638:~$ sudo dmesg | grep 128 > [ 0.000000] IOAPIC[0]: apic_id 128, version 33, address 0xfec00000, GSI 0-23 > [ 0.000000] smpboot: Allowing 128 CPUs, 64 hotplug CPUs > [ 0.000000] setup_percpu: NR_CPUS:512 nr_cpumask_bits:512 nr_cpu_ids:128 nr_node_ids:1 > ... > [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=128, Nodes=1 > [ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=512 to nr_cpu_ids=128. > [ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=128 > urezki@pc638:~$ > > > For example SLUB thinks that it deals with 128 CPUs in the system what is > wrong if i do not miss something. Since nr_cpu_ids is broken(?), thus the > "cpu_possible_mask" does not correspond to reality as well. > > Any thoughts? This is not a 5.8-rc3 problem. Almost all AMD CPUs and APUs are looking like this. The only CPUs I own are getting that right is a dual EPYC box, everything else is broken regarding the right C/T & socket(s) count, and that probably bc is using NUAM code to have the info. I reported that a while back and no-one ever cared. There is even a comment in the hotplug code saying setting the wrong CPU count is a waste of resources. I have a 2200G is reporting 48Cores. AMD Ryzen 7 3750H reporting twice the cores and twice the socket. ... [ 0.040578] smpboot: Allowing 16 CPUs, 8 hotplug CPUs ... [ 0.382122] smpboot: Max logical packages: 2 .. I boot all the boxes restricting the cores to the correct count on the command line. Wasted resource or not, this is still a bug IMO. Best Regards, Gabriel C