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=-2.6 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, USER_AGENT_SANE_1 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 29295C433E0 for ; Fri, 3 Jul 2020 17:24:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DF11720708 for ; Fri, 3 Jul 2020 17:24:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UtiiMTj2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DF11720708 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 56A788D0096; Fri, 3 Jul 2020 13:24:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 51A4E8D0074; Fri, 3 Jul 2020 13:24:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 408698D0096; Fri, 3 Jul 2020 13:24:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0213.hostedemail.com [216.40.44.213]) by kanga.kvack.org (Postfix) with ESMTP id 274EA8D0074 for ; Fri, 3 Jul 2020 13:24:25 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id A8AC8824556B for ; Fri, 3 Jul 2020 17:24:24 +0000 (UTC) X-FDA: 76997438448.27.team16_1407d6826e93 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin27.hostedemail.com (Postfix) with ESMTP id 858B13F031 for ; Fri, 3 Jul 2020 17:24:24 +0000 (UTC) X-HE-Tag: team16_1407d6826e93 X-Filterd-Recvd-Size: 5457 Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) by imf50.hostedemail.com (Postfix) with ESMTP for ; Fri, 3 Jul 2020 17:24:24 +0000 (UTC) Received: by mail-lj1-f170.google.com with SMTP id e4so37872453ljn.4 for ; Fri, 03 Jul 2020 10:24:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Y0m/WnflXUtqMe2LlYe5Q/lJZbxP3+0PbCBQFE408oM=; b=UtiiMTj20+O4Gm8B4qFya+91EHiKSOIFYa1Bn6p0LEGsHLXSz2WTgv86sY6RHY6MpJ HgV0YHuiTDfEYqvVRTyq6rTn+V78jFQHQwS75DpYZ6QK6+aaGy0XZmYFTtLgKAxK9Qy0 O/0CHtw96yhCQn7fuYzuThoavDcn65jAg/RAR5eyxZXGyj5lXG6Tjk+5v8rqYIWxLDYn rjEv2IbEZ99IFicttcZQ2UG6mrfrYjgxYBiy1rq1R8GzfDNfmSFhsRWF0fPf6tTaLXVi 9nuKWjMC2vuXtRnJZlIGA1kJ9waXe43bVBcnbAyNWDaVKh2lGMvPGfegIQEhaBqyUcVO OXeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Y0m/WnflXUtqMe2LlYe5Q/lJZbxP3+0PbCBQFE408oM=; b=hBeZmNOerNJoyAXm2EN+d/EDhPbbFpg+l2fylhitW1j/jzcEA0MkMKKRHIIWdPt8u5 w2YIM6Ag01EhkJ74Sfw1+UaQx/FDMY8iJy2aNlG/vOxOT0f5H2oLmZTHOTTEV0DpREsb B55Y9he/hQQWg6JsrGN/qHi0IECAn0NXOzo28oFlpglrZGf3IA+RxSkfjJFTYlgvTi/W 6OtZ+E+UoUEGauYyzoVMp67EOGvnt9wbOXT9WpTKeSvsjbZlJEtYnfyXur+k/KOGOmzQ Myd8Y9gQQE1C/Z75/bDu2VFVChGeraSFiq2r/IcIHdftm37cI6QnSbOYZfK4QuCjTmtr QJhg== X-Gm-Message-State: AOAM530m/TVXffiCVh5wsXgCTfadhsueYdmAqcOcZpMW0k0M2Gqq/EjR +DfuAIvqJ68ObUByxak/iHA= X-Google-Smtp-Source: ABdhPJyWXeQlDf8x2WW9gu+kNwpc0tMMA9+cBa+Mp8VX3gBuxeRcCJKAQPfv3GJM9A+kGC0J1tVgEA== X-Received: by 2002:a2e:3111:: with SMTP id x17mr18889387ljx.33.1593797062759; Fri, 03 Jul 2020 10:24:22 -0700 (PDT) Received: from pc636 (h5ef52e31.seluork.dyn.perspektivbredband.net. [94.245.46.49]) by smtp.gmail.com with ESMTPSA id w19sm1586315ljh.106.2020.07.03.10.24.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jul 2020 10:24:22 -0700 (PDT) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Fri, 3 Jul 2020 19:24:18 +0200 To: Gabriel C Cc: Uladzislau Rezki , LKML , linux-mm@kvack.org, Andrew Morton , Linus Torvalds , GregKroah-Hartmangregkh@linuxfoundation.org, "Peter Zijlstra (Intel)" Subject: Re: nr_cpu_ids vs AMD 3970x(32 physical CPUs) Message-ID: <20200703172418.GA4500@pc636> References: <20200703155749.GA6255@pc636> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 858B13F031 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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: > > > > 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. > I suspect that DEFINE_PER_CPU variables can be twice as big, but i have not checked it actually. So, if the code needs to identify real number of CPUs it can be a challenge :) Thanks. -- Vlad Rezki