Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2630300ybt; Fri, 3 Jul 2020 14:22:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxft5XatkF4JJdLRefmsTRInCnW/DELheg0e1B/ipH3uefE5mkCT5YTLlLrpJj6JnDgYGHS X-Received: by 2002:a17:906:c453:: with SMTP id ck19mr8001101ejb.185.1593811342994; Fri, 03 Jul 2020 14:22:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593811342; cv=none; d=google.com; s=arc-20160816; b=oMyDNeWW32DbskrNBo6T77d133i51pBb/qY0fmeFA8hCRKzFrtkdqriCfcHFuD0TYe dm0ta5ks/Tm1UXhPiizyKKvkNCpqXBiOBAJzgfaPWsloIb/8FaDVOnt//DpA/AdsI47j Fq5UifX2Y+HIHsFopWL831OCj3vMNq/GfM6NMjseFAcPcMpwRdpPoZP5EeBszY7w5GQj RzbzPpmq5ibz/bPvvFrx1cKxo6RKBxhlD43rwmKXsRRfaSK4zg5m2TMB0uKXVP9kj98Y 6/Mypi9qe61Siou7H0Es0sOLofz/qkh5gMstBvEJAoNVAB1vOOu8xUEPa+P9OKZoPzvV J0Pg== 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=c/MbgL1LaNESZUToz3uJlzJ2ui/ekBMYL4fZtBX3Egc=; b=exhrOOOt+ITLjw3bzWeYBukQl5a2n/gouIiAMjUrZvnYE3rqBVO7buIFbg4sxkZJgI 62mtgfz0cfvoj4ZY10tv0S+BLhsCFMP2le0PJRpv+nge+EXIHzgmxGfucbOKlAFFjvYs QNB2enQYpHgwwhtqc3LFqFjpo0JXf2sZOt9koTdwcs/3jynAefb2UG81w/7fine+yQn2 aB1tG2ZmDS8GbVG1PE50xtyvKPPI93kAQ6prPODeJpdjOmC/mbxVhr3nwcaRidNRx/gH zNj6RtL77sqhYy7RzsVIZ6aL+2qw+hEApWGvcK4TERDAqVl0G/E0UH4OKo5TDFM7cs7T N9rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VlkQ2snH; 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 l10si8290603ejh.673.2020.07.03.14.21.59; Fri, 03 Jul 2020 14:22:22 -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=VlkQ2snH; 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 S1726669AbgGCVUw (ORCPT + 99 others); Fri, 3 Jul 2020 17:20:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726379AbgGCVUw (ORCPT ); Fri, 3 Jul 2020 17:20:52 -0400 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B674FC061794 for ; Fri, 3 Jul 2020 14:20:51 -0700 (PDT) Received: by mail-lj1-x231.google.com with SMTP id f5so22622157ljj.10 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=cKhF8pX55FmLv9dQ4d2JO6GBtjZWW2KzaCeQ5sk1+Iuqkc5LT7kVt3JQ5or8x8nsKG RuhKVKbuPt8X545XJScvXP/sHtTeFKpBSDypRBH59l9WkmLxA9ytsgyxKuSC/yl0/G9i Y8xkE+xiq6Ii4ARdGCzRRY1KrNvrfUjqYrKc0rxrvF3cpVdi/X5Du6JBPdNhzoiIu0DT 0/+26dl0/wUNQm92wSbCvlboDTJfhdkTLZwQxRAt1X1XK25JtPXEayY8sKWV1IVJKIgw i08zk2Qf6HgZiOUjSMGplwrv2ozhF4crQUnBWP77KYQIkMaQMYToKFAAW6NsgxPvzIlw ZeMQ== X-Gm-Message-State: AOAM5320yU7/4SbrvHsmVxDdC+oLmuQUwFMn44x7G+Py/cZ2mtNfHTjB Ef1DItuZYgOadeglu4flG/g= 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) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > 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