From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 618CCC433DF for ; Fri, 3 Jul 2020 17:08:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 291FD20760 for ; Fri, 3 Jul 2020 17:08:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=googlemail.com header.i=@googlemail.com header.b="lQwRKFro" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 291FD20760 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7468D8D0093; Fri, 3 Jul 2020 13:08:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6F6C78D0074; Fri, 3 Jul 2020 13:08:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5E5AB8D0093; Fri, 3 Jul 2020 13:08:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0122.hostedemail.com [216.40.44.122]) by kanga.kvack.org (Postfix) with ESMTP id 475BE8D0074 for ; Fri, 3 Jul 2020 13:08:08 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id C4CF18248068 for ; Fri, 3 Jul 2020 17:08:07 +0000 (UTC) X-FDA: 76997397414.09.brush20_510d83626e93 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin09.hostedemail.com (Postfix) with ESMTP id 9B371180AD802 for ; Fri, 3 Jul 2020 17:08:07 +0000 (UTC) X-HE-Tag: brush20_510d83626e93 X-Filterd-Recvd-Size: 4698 Received: from mail-lf1-f65.google.com (mail-lf1-f65.google.com [209.85.167.65]) by imf44.hostedemail.com (Postfix) with ESMTP for ; Fri, 3 Jul 2020 17:08:07 +0000 (UTC) Received: by mail-lf1-f65.google.com with SMTP id g139so18885623lfd.10 for ; Fri, 03 Jul 2020 10:08:07 -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=fR5dq9Xsg1fMYq4uwgHvYBS6g47l+zV6l7q5BLQLpZxD1q/SC88mOCA6A4cB01/nuU dbTTuiaCYpZW38+KChzCaOTd0CYtnNsKJqLmiiWmTwgZ1d/OdLSjjmrNPW7EYdFMR3i6 yf2q1nUldjwvTACni47JGoHQo+bSRaR0mXHqaP6bnPoi9wbHvcSj+p5tQBw69++VS5dF MI4wTHTs96Wb53i86QYzqP29LKVe8M0AtMMae7R1FYWMe/czduX4noYPC7usjpWC1Xv+ 4mfXfpvBgfuNo1dFAA1Eek5kXh01JweSVCrob/EQqpYL41uRtgjMx3i7MUnssD/wWJoJ uwqA== X-Gm-Message-State: AOAM531gPuSzJZbrqlORg63dUjcCVOn+fyHV3DremVGSUh9p0IS3ixpi Xl/PfhCqQFbBmj+yrxwGg4rAU5IjKnrq3rfEPg== X-Google-Smtp-Source: ABdhPJxUWKoOZWgsUGY+b0V4Mt13R2qjCpnNvZ54FXAo55sJdwmd5hZqaFXU13je82BQtku2OjEGo0UtL9y9uo7v7s0= 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" X-Rspamd-Queue-Id: 9B371180AD802 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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