Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2498075ybt; Fri, 3 Jul 2020 10:25:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynpN1bLZhconbVCMuU8cEeJXV+NpWnQ0VmJRKRFjdMURP0geG844DvJm+mnKScGr1Lfcoz X-Received: by 2002:a17:906:7c54:: with SMTP id g20mr33913736ejp.460.1593797113883; Fri, 03 Jul 2020 10:25:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593797113; cv=none; d=google.com; s=arc-20160816; b=h+tUPeMDYWwKCeyrlor3peyr8vwd9gxo/H7Wl0jx0zAD85N6+vEn2Xzk97rUjNhByc eak56dEOdRZ6JHykl1rzljQNQG3DvI1M1Zu0KWovEWwUqTMe6m5MlqYAtQPeetuUtWsE 2DdGEOUJAPv+f1GExsKJUte7K2HpI9hzizzsDvmYe7N2JhXVLOS0w0FAfm12SvBcGnqH 5Nxc/ad3EDipgobXAP2r5gaxHdvOwYXMzaCsxxMhd+LmWRGF3ED2xlgoOwZFZsDtyePa UfcOgT/IrNYzaerXSL/y/Z1oh9+D68e1gDmrDEBQwXhtVIA47igLIIHwZ67KxbGpyDmw s/Tg== 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:date:from:dkim-signature; bh=Y0m/WnflXUtqMe2LlYe5Q/lJZbxP3+0PbCBQFE408oM=; b=eQUYlWkUxztDCCIVn8FDX2QzLODFPk/9IfCGp/pwoPYEAgUkgU21MzvmnC5hy/mOn1 6XLRkH9K65nlUvWELU9iQYdxiEoFyaE6ez8ZBx8lWBCLDywpfWXi5FOC01r8nCGFVMky u9GgdgQ0pW2yNtiaVLM3W2c2yeYyVkiqdJkAIxDd1jkfMSKWSqfaG8VoCQPdbRJIMDhM DkBhuma22PezXfuXovKAzTcuMhRPc7m+D+Lx+flVJ8TxAbSQubWUzup0W2ibTj2xsPSK D4NgZL201F4/CRBicA5tkgdDI+Z4lKDpD6VxpYkfGVq4tDjFhsSHvILseqj2nVpZTIvj LgLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UtiiMTj2; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e22si8514364ejb.66.2020.07.03.10.24.50; Fri, 03 Jul 2020 10:25:13 -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=@gmail.com header.s=20161025 header.b=UtiiMTj2; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726477AbgGCRYZ (ORCPT + 99 others); Fri, 3 Jul 2020 13:24:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726157AbgGCRYY (ORCPT ); Fri, 3 Jul 2020 13:24:24 -0400 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 481CBC061794 for ; Fri, 3 Jul 2020 10:24:24 -0700 (PDT) Received: by mail-lj1-x233.google.com with SMTP id t25so33239591lji.12 for ; Fri, 03 Jul 2020 10:24:24 -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=ZUTjhuicabFjb4NaQIi69cwygXzDaZwbCKggFxGES1tVTYF8v6kr1Hr+4Ak8SApi5X YlNRwBdNLEZFXIOdVMaG9kM7PXFoznT0gLNGejPIpI8wjrTjMoCjKn2uNE35V5/QyaGu t2cepm7a3kubxviiY/nKpHRJE91amfyPioWjydomB06sNi3dRYSmje6KJqWX1nB4Nf9H n026z4fO6KYw6VUwL+akzLyHg+csomDMfE8xuj7PWEVbIyaksWbJcN3Ce4yBLgjuBFyy +QkSkwC5zW/G14Gh1zv6W8+3oEb5w2Mbg7koNKsZ6/pskW8lp6YBenJeRNsox0tikHlX LejQ== X-Gm-Message-State: AOAM532OgjwjmPxhy5rRGjKgFDSVaiVU5XlXZ8zAMAmO1BatvI1y1dfT t4uJn/cPOtAoYi8i22fiE+wCtOH23zRiOg== 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) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > > > 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