Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6181874rwi; Tue, 18 Oct 2022 09:04:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6y5PZJJ8tYIgU/IiZ/G8QIs7ZbAlk5CZyUkPMM2g9aOVDiK2v2j4sB2I96JChbzQZ/Vel4 X-Received: by 2002:a63:df03:0:b0:462:cfa2:2871 with SMTP id u3-20020a63df03000000b00462cfa22871mr3208526pgg.225.1666109078074; Tue, 18 Oct 2022 09:04:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666109078; cv=none; d=google.com; s=arc-20160816; b=Pd9zEjdeedLPXQP9yvS8LwivUxzpANhWPA3gZ5P+e0hCUkWhLCV7UuPyjyoZPK0TPW U9SJr10HogqEqDDizBo+48cJcRUsS62SOTdbTzz6EsI5i+qDFJvfbA9/tsozeGdWB8+s vjTCXfsg7jnD2yK/oQjjvbRs73dabDhRYpIO+ZDyhVua1y+So4FLj2LryZ4JBYxQuvxl kMJXgYNwKsaF07Hr1mgwn0Gfm5ardyFAx/gD2v5YKFPd93dWcwwo9iksBbfOFLSrmVwR abK5jUfTgUrrTD1CqC/7tDdMC+WHI/ApH+xITGbtOHoiSmJzBciNbAPjYBTirFyWyFfl yjDQ== 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=/y9qyGY5iRRsI0juheW5gC+VHaPihspfGREH3Qe0x8o=; b=bL6SENM7GABdoEhpMIGj4DOebllJWvhRaboE/w9zxCVbWy8AtcMJzwwgcB6xd3LUA7 abp+dOWy1rO1aFkOulrCcUuxvylGF6aMqm3r44H2L7Tz4yAyzuzd9IulO26OvWcW/OqV PLhdF4lJ048EifhAimr4OI3KkUhDr59WLRxcwng2bLG557DqYJz/cQMFhJoFFxEIrUFB DW2SQwJ/n9nMWBhKfYQkdp5U161P99LE3ywhvWBud5uKmHolxTuUaAntv/Oa6HnU2s3O h+7MWGCsJxulJEzW8Y4TcZaRua7b6+8pCVt8Gt/3ILPcPWmbBqn1PceDbmVMMtPfNuv/ N6lg== 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 me8-20020a17090b17c800b001fd6e58cd98si19445780pjb.123.2022.10.18.09.04.07; Tue, 18 Oct 2022 09:04:37 -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 S229947AbiJRPQF (ORCPT + 99 others); Tue, 18 Oct 2022 11:16:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229868AbiJRPP5 (ORCPT ); Tue, 18 Oct 2022 11:15:57 -0400 Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD70386F98 for ; Tue, 18 Oct 2022 08:15:56 -0700 (PDT) Received: by mail-qk1-f181.google.com with SMTP id o2so8802971qkk.10 for ; Tue, 18 Oct 2022 08:15:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/y9qyGY5iRRsI0juheW5gC+VHaPihspfGREH3Qe0x8o=; b=404InUcM5IWIcXu/0AG8cxoKTDAEf0p6SbVk3gCRKnBY3NgPZSO1XeF90vGh50Vs2b sTHvsMlVrXKk9/9Pkl5+PKcTv2VDUhknobmOAByLyKpufjY0NgJTjSi7gRF5K3xlFl3t Y4qM6hQbQLn569kjORI1elTZSZuwheJJNZVXJnrlJ+FwfWDo4vqMuRahdXam7QPrGWPI XZoACmgSSctrqwCcYvRSnepfvUnCTyInUvhH6x3xxu1hpCkx2uOmQ8tCBvNTXw4cnf8S cWwMEQZi7NkvTQM1Ll9kAE4e5ZMOc9T+YANRx99loMgxhPyM5F+2z2s2dkY+iHaxB6nl Wnaw== X-Gm-Message-State: ACrzQf12XyxpLvrS+k3EUUuAz8JKkg+xwO85BebVVRkiEz1w0rBvsuZv qi1bna26qWakMm4jgwaLuiZYweZ8IvkuU3Bp X-Received: by 2002:a05:620a:2698:b0:6cf:38bb:f705 with SMTP id c24-20020a05620a269800b006cf38bbf705mr2228231qkp.130.1666106155627; Tue, 18 Oct 2022 08:15:55 -0700 (PDT) Received: from mail-yb1-f175.google.com (mail-yb1-f175.google.com. [209.85.219.175]) by smtp.gmail.com with ESMTPSA id bp17-20020a05620a459100b006ce3f1af120sm2653982qkb.44.2022.10.18.08.15.54 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 18 Oct 2022 08:15:55 -0700 (PDT) Received: by mail-yb1-f175.google.com with SMTP id t186so17329028yba.12 for ; Tue, 18 Oct 2022 08:15:54 -0700 (PDT) X-Received: by 2002:a25:687:0:b0:6c2:2b0c:26e with SMTP id 129-20020a250687000000b006c22b0c026emr2856337ybg.202.1666106154019; Tue, 18 Oct 2022 08:15:54 -0700 (PDT) MIME-Version: 1.0 References: <20220905230820.3295223-1-yury.norov@gmail.com> <20220905230820.3295223-6-yury.norov@gmail.com> In-Reply-To: From: Geert Uytterhoeven Date: Tue, 18 Oct 2022 17:15:41 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 5/5] lib/cpumask: add FORCE_NR_CPUS config option To: Yury Norov Cc: Andy Shevchenko , Andreas Schwab , linux-kernel@vger.kernel.org, Rasmus Villemoes , Andrew Morton , Stephen Rothwell , Peter Zijlstra , Thomas Gleixner , "Paul E . McKenney" , Vlastimil Babka , Dmitry Vyukov , Valentin Schneider , Sander Vanheule , Alexey Klimov , Eric Biggers , linux-riscv Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no 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 Hi Yuri, On Tue, Oct 18, 2022 at 5:01 PM Yury Norov wrote: > On Tue, Oct 18, 2022 at 05:44:09PM +0300, Andy Shevchenko wrote: > > On Tue, Oct 18, 2022 at 07:35:09AM -0700, Yury Norov wrote: > > > On Tue, Oct 18, 2022 at 03:50:31PM +0200, Geert Uytterhoeven wrote: > > > > ... > > > > > For those who choose FORCE_NR_CPUS, it's required to set NR_CPUS > > > to a value that matches to what's parsed from DT. > > > > > > Can you please look at the draft below that disables FORCE_NR_CPUS > > > in allmodconfig? If it's OK with you, I'll send a patch. If you think > > > that there are architectures where it's not possible to set correct > > > NR_CPUS at compile time for some reason, I'll add ARCH_UNFORCE_NR_CPUS > > > option. > > > > Instead you may simply add > > > > depends on CONFIG_$ARCH/$MACHINE=n > > > > and so on to the FORCE_NR_CPUS, no? > > Yes, if there's just one machine like that. If there's many of them, the > 'depends' list would be too long. > > I hope there's no such a weird machines, and we don't need that at > all. Let's see what Geert will say. I haven't tried the patch from your other email yet, but I did try CONFIG_NR_CPUS=4 and CONFIG_FORCE_NR_CPUS=y on Icicle earlier today. There was no warning, as the number of CPUs did match, but the fourth CPU (cpu@4, i.e. the fifth core in DT) failed to come online: CPU3: failed to come online smp: Brought up 1 node, 3 CPUs BTW, it behaves the same with CONFIG_FORCE_NR_CPUS=n. Increasing CONFIG_NR_CPUS (before I used 8) makes the fourth CPU core come online again. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds