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 CE2C4C433DF for ; Fri, 3 Jul 2020 21:20:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6FF3C20782 for ; Fri, 3 Jul 2020 21:20:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VlkQ2snH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6FF3C20782 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 E88CB8D001A; Fri, 3 Jul 2020 17:20:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E123B8D0010; Fri, 3 Jul 2020 17:20:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CB2818D001A; Fri, 3 Jul 2020 17:20:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0235.hostedemail.com [216.40.44.235]) by kanga.kvack.org (Postfix) with ESMTP id B27398D0010 for ; Fri, 3 Jul 2020 17:20:52 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 4C8A3181AC9C6 for ; Fri, 3 Jul 2020 21:20:52 +0000 (UTC) X-FDA: 76998034344.05.vein02_210931026e95 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin05.hostedemail.com (Postfix) with ESMTP id 295EA1840B38C for ; Fri, 3 Jul 2020 21:20:52 +0000 (UTC) X-HE-Tag: vein02_210931026e95 X-Filterd-Recvd-Size: 4913 Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) by imf45.hostedemail.com (Postfix) with ESMTP for ; Fri, 3 Jul 2020 21:20:51 +0000 (UTC) Received: by mail-lj1-f181.google.com with SMTP id d17so23783800ljl.3 for ; Fri, 03 Jul 2020 14:20:51 -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=c/MbgL1LaNESZUToz3uJlzJ2ui/ekBMYL4fZtBX3Egc=; b=VlkQ2snH17Nx8tnyUUXS8aJlif+f+BBvhgd4z0f+MxldVnreE3EP4CYW4LA7EGIDhj dXR2vpysrFON09qIoMq/aWgH26InLa4wn3ZLYAHa5xG6I4JAIJsr67zY53oXd7CtFNSa Gr9OWH9O7DOqKywXNgY47QnwBblDn7mAFTgzEJPIvfmFzgQWrDZHPnRHLDeTbwODV1Jh hFUSPX8GvUG+KgWG9olWcw4+6QZFslJSZAu3xWRKupugaVXePFw2tr2X47Rjk3NSh3f3 y64L9XEcrxtHCVRUurhM9WBELBrWHL9UisKH+BROgkkwPbJFssoprgSLhnjUidSZbbJm +FpQ== 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=c/MbgL1LaNESZUToz3uJlzJ2ui/ekBMYL4fZtBX3Egc=; b=uoJ0isQ78w58IDROMdu7xrXYxtMclrCI70eQyi70yUN7KNWzcJPoLilterQCrgWr0A onMiFAD/FajCz9VGyhc5h09VLmEbI05rl3BXRs6uaO7YsoPcUQsp1nnjVXjbDnYEUfE4 dnkn4fMNDBzktt/UtcAopwFWcv2nxfHS1M3dT+PFb8ly4JJmVUMTfWFdmyqsjunHaYaD WZS/mulY5X9QGopyfuVTOwOgsGvpZKrCHvKaWTDNzTkjKiyoKRCya+rT4C6R6XbW+uWa ZlCvU6W3evAKioaw2ORGrBxtdTFFa4B4aT4UWOguWdKKAv1s/HT9nFmBGeHG2BNClMcQ zfGQ== X-Gm-Message-State: AOAM532NqEpRcxJvJawU93HblCOuvsNTsCxNdFkZ8AjcOPfhD6wogd9+ SLVtpBKa8k9b7ZjcUtympVM= X-Google-Smtp-Source: ABdhPJz7APU8pkcq+8yZ4qEdXTT4WoMK1+FIo4Mt4B//td9fvanPBxvtv3k39NVoKUOsOF8IcgyCVw== X-Received: by 2002:a05:651c:1aa:: with SMTP id c10mr16560900ljn.260.1593811250132; Fri, 03 Jul 2020 14:20:50 -0700 (PDT) Received: from pc636 (h5ef52e31.seluork.dyn.perspektivbredband.net. [94.245.46.49]) by smtp.gmail.com with ESMTPSA id f14sm5085801lfa.35.2020.07.03.14.20.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jul 2020 14:20:49 -0700 (PDT) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Fri, 3 Jul 2020 23:20:47 +0200 To: Linus Torvalds Cc: Uladzislau Rezki , peter enderborg , Linux Kernel Mailing List , Linux-MM , Andrew Morton , GregKroah-Hartmangregkh@linuxfoundation.org, Peter Zijlstra Subject: Re: nr_cpu_ids vs AMD 3970x(32 physical CPUs) Message-ID: <20200703212047.GA6856@pc636> References: <20200703155749.GA6255@pc636> <8a2a55e6-6087-e4bf-3d35-ed4b4c216369@sony.com> <20200703192807.GB5207@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: 295EA1840B38C 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: > On Fri, Jul 3, 2020 at 12:28 PM Uladzislau Rezki wrote: > > > > I have MSI TRX40 with latest BIOS. > > I think it's just that the BIOS is set for the max possible, in case > you'd have a 3990X. > 3990x is the top one in this series, so indeed it can be a case and explanation why nr_cpu_ids is set to 128. > > I compile my kernel with CONFIG_NR_CPUS's set to 64. That works around > the issue. > > Lots of distros seem to set CONFIG_MAXSMP to true, which I guess is > the most generic thing to do, but the problem with that is not just > the silly problem with the BIOS, but it also means that the kernel > does dynamic allocation for cpumasks even if you _don't_ have that > problem, because at compile-time you don't know how big the cpumask > will be. > > With CONFIG_NR_CPUS's set to 64, the kernel will just use a "unsigned > long" on the stack (and in various data structures) and be done with > it, and not do unnecessary dynamic allocations. > Thanks for proposed workaround! I will update the CONFIG_NR_CPUS with proper value in my .config Some background: Actually i have been thinking about making vmalloc address space to be per-CPU, i.e. divide it to per-CPU address space making an allocation lock-less. It will eliminate a high lock contention. When i have done a prototype i noticed and realized that there is a silly issue with nr_cpu_ids on some systems. Therefore i reported about it. Thanks, Linus! -- Vlad Rezki