Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2380373pxp; Fri, 18 Mar 2022 09:20:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKmZqu+FCtM28BbUCXmntnOUZDBq0fOktQ5LBeMqDK3+v2/HDCit4sT2OeSQSavbrOjdJn X-Received: by 2002:a17:906:d115:b0:6db:ad2f:bffb with SMTP id b21-20020a170906d11500b006dbad2fbffbmr10006072ejz.124.1647620453304; Fri, 18 Mar 2022 09:20:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647620453; cv=none; d=google.com; s=arc-20160816; b=G8US2etF/kbtIIjOxJGCvpqR5wEbpcrhNlCFZrEPfwQ/nTkIhBEHi09kbyok0gMedw 5GwxkcpFGmRobBvUyREOTSh/zquDLafnmabwu6Oq1y7UFzby9INBFW1dhPGczoBV5XEv 6yzEkQ5nq30Ukjhje/A5hJDDT/XnfZQa3FQDMBFkQD6MeEe66w0A9r+J84sV4ClfOug7 aUiy16dvVR366RQCH2N09keNd3j3M47xYax8MRJOTNLMbykICB8hdaM0OQuNiogcRM7g bCRcffhb8Ac5EIdwUqUuUydiTXqpXf0j9uIkUu3rHfE991q5Df4V8alP8OAGqJNL/QCU ygPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=weFswAqkIlHIaq8k7lljWWKvjmc5J3NIw2mWb13Gpco=; b=R9KMxTkaht2PRFCGb4Wt2uAlPz1w0bNt4kxIKZqtlNyuXZgdzQ8YigFniIIErzF4Va nqD44emU96cVTSQFyoTSQlUZ96pN+u3kKePNz6Hu7mkvUCD7OyWZwi9+mjKgwwbUGFmt xVw3h+XJ7s+HRWB+ZE1BmkVDtu0HGSakaWCr2N2GfoFwryn28Y7WZ3B54AtllgSISyFj UYzAZN4vCRHqlxYHo8I49sworU8GFfrJmSPtDu7fDXIzXLZ/r01iZkBC45vS9+2fK3re Vl2+JRbhjaAUlO/20xstjeVXUAMBDxCVQes01ev0K71hVuq3UfNVFty89bxN8bKx5bji KZig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m17-20020a17090677d100b006df76385bbfsi1425590ejn.95.2022.03.18.09.20.28; Fri, 18 Mar 2022 09:20:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237864AbiCRPQE (ORCPT + 99 others); Fri, 18 Mar 2022 11:16:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237860AbiCRPQC (ORCPT ); Fri, 18 Mar 2022 11:16:02 -0400 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E0502B269 for ; Fri, 18 Mar 2022 08:14:42 -0700 (PDT) Received: from mail-wm1-f51.google.com ([209.85.128.51]) by mrelayeu.kundenserver.de (mreue011 [213.165.67.97]) with ESMTPSA (Nemesis) id 1MKsSj-1noHfR3AY1-00LFNc for ; Fri, 18 Mar 2022 16:14:40 +0100 Received: by mail-wm1-f51.google.com with SMTP id 185so175585wmc.3 for ; Fri, 18 Mar 2022 08:14:40 -0700 (PDT) X-Gm-Message-State: AOAM530QfFTI+E5/R5OgJ1kDyG6f8bK1l7PSjTW2Az0dVywNNKcCll/x 9WibE6Rvvn4uY1pu1TJmh7/Rz813qAlh4PQYLNQ= X-Received: by 2002:a1c:f20b:0:b0:389:c99a:4360 with SMTP id s11-20020a1cf20b000000b00389c99a4360mr16133111wmc.174.1647616480413; Fri, 18 Mar 2022 08:14:40 -0700 (PDT) MIME-Version: 1.0 References: <20220317035542.272547-1-apatel@ventanamicro.com> In-Reply-To: From: Arnd Bergmann Date: Fri, 18 Mar 2022 16:14:24 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] RISC-V: Increase range and default value of NR_CPUS To: Ben Dooks Cc: Anup Patel , Palmer Dabbelt , Paul Walmsley , Atish Patra , Alistair Francis , Anup Patel , linux-riscv , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:0u696iFwhgtQPB7cmok0FaPu+YHTMlZL2K9zWDQud7YcV/g9Ghp Uv/NyzpvWJwxPJm04FPTuVOpgBVMKdq5dxwPJlZEx5TUaKmFbkzqdRcZwpki4YzGyIs6g09 X2lJzYbfRPFRv7iQJKrKE0Wbnuzbl1DY5uFserGtV+EAwpGdpJVfA48dyq4r1pihq+bhu4N RSMHk+J7HSJfOs2EvU8tg== X-UI-Out-Filterresults: notjunk:1;V03:K0:sZTjOT3gUbc=:4jtS79mfZVxATiOoMmt/0J gU5WYl911jGLGxiOMclzoz2UXEwLFKdmYKEyxcC9PQhKbDpKZRela9pX0ORwrQREx/PC0AWY0 2XnDHppQhp1e2OtD3GJYo3PkZVJwdZzvgz8aHgS6MhJObWmdz7uzgJxvC8OfevrUAfMfjaix3 lyiXkLll81eiaeAMWfQHUhUH7OVIpb3lB4ntEV0CVhD27V8rtGVZvPKVGHJDEL+lRzMJks1xt u2qsk2s2XGmWtn1mEg6NRSsgXKWqNDMSDy1pNYms6R37OPQxPvS0lOVMzxAccIhUJ47g3R9Tt Pv4NY1hBiKZS7QyG5vzYxMStkYMEjFuF0WuATRY6rdwQZRTMaJbM96qRMVrKCgseGx5SH2KgK KQ2odymORHz6lGep6bmFncG7sfW/gpwKtSejXBWc0o+d2sd+TSe0TYaujrhPRxEo3x71dJKHo JZKRG5ZFSkA75mAvB28A9BKne0A785X0Y2NOIJQfJ8swjURogPD0wNRdbtUH8fOiV0YyBpFym 4eb88kGugokyWAFlNWSCFCNhLhs8ArcEPRIUluMURLw7alTDIDhzTKQ1Wrd8PGCzA4hHc2YJq ABqhV0yL89WB962ddi0365jEYkL/pKtWnQKL+yqK/Rltldv+E8Aq/tUcTV0ve4mUwv8zy3TVB a6tjwQ3J1MemhEjAyUglw5q1bCe75BkHIAEv/h1x4tjHX9FqHtQW9zCCCXUGG0XABX7U= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 18, 2022 at 3:46 PM Ben Dooks wrote: > > On 17/03/2022 03:55, Anup Patel wrote: > > Currently, the range and default value of NR_CPUS is too restrictive > > for high-end RISC-V systems with large number of HARTs. The latest > > QEMU virt machine supports upto 512 CPUs so the current NR_CPUS is > > restrictive for QEMU as well. If qemu allows 512, what is the reason for limiting the kernel to 256? > > Other major architectures (such as > > ARM64, x86_64, MIPS, etc) have a much higher range and default > > value of NR_CPUS. > > What's the memory overhead for increasing this? It's supposed to be very small, I would expect three main sources of overhead: - cpumask_t variables, those grow once you go beyond the size of an unsigned long (32 or 64 bits), so with the default just on the limit, this makes no difference. Note that you can run out of stack space with NR_CPUS values if CONFIG_CPUMASK_OFFSTACK is disabled. Should not be a problem for 512 or below. - percpu variables: these are dynamically allocated based on the number of CPUs at boot time, so they should not have any real impact. - NR_CPUS sized arrays, these are sometimes used in place of percpu data. This is only a problem if the array members individually are more than a few bytes. There are not too many of these in the kernel, as using those is discouraged. Arnd