netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ricardo Nabinger Sanchez <rnsanchez@gmail.com>
To: Eric Dumazet <edumazet@google.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
	netdev@vger.kernel.org
Subject: Re: panic in udp_init() when using FORCE_NR_CPUS
Date: Tue, 13 Jun 2023 18:22:15 -0300	[thread overview]
Message-ID: <20230613182215.33bfc5ef@espresso.lan.box> (raw)
In-Reply-To: <CANn89i+5DoHFh-2MvLy740ikLdV-sE8pEEM+R=i0i77Pyc1ADQ@mail.gmail.com>

Hi Eric,

On Tue, 13 Jun 2023 22:19:33 +0200
Eric Dumazet <edumazet@google.com> wrote:

> Sure, but you did not give NR_CPUS value ?
> 
> Also posting the stack trace might be useful.

That's puzzling.  From menuconfig (which I always use), it is a bool:

[*] Set number of CPUs at compile time 

CONFIG_FORCE_NR_CPUS:

Say Yes if you have NR_CPUS set to an actual number of possible
CPUs in your system, not to a default value. This forces the core
code to rely on compile-time value and optimize kernel routines
better.

Symbol: FORCE_NR_CPUS [=y]
Type  : bool
Defined at lib/Kconfig:540
  Prompt: Set number of CPUs at compile time
  Depends on: SMP [=y] && EXPERT [=y] && !COMPILE_TEST [=n]
  Location:
    -> Library routines
      -> Set number of CPUs at compile time (FORCE_NR_CPUS [=y])



So I took another look into how I was setting these, and since I had
not realized I would need to disable MAXSMP and only then be able to
set NR_CPUS.  I must have misunderstood the help sections; the wording
suggests me that one of those knobs would trigger some automatic
enumeration.

Here is the diff on my resulting .config:

--- .config.old	2023-06-13 17:33:41.152720907 -0300
+++ .config	2023-06-13 17:46:48.515676191 -0300
@@ -388,11 +388,11 @@
 CONFIG_HPET_EMULATE_RTC=y
 CONFIG_DMI=y
 CONFIG_BOOT_VESA_SUPPORT=y
-CONFIG_MAXSMP=y
-CONFIG_NR_CPUS_RANGE_BEGIN=8192
-CONFIG_NR_CPUS_RANGE_END=8192
-CONFIG_NR_CPUS_DEFAULT=8192
-CONFIG_NR_CPUS=8192
+# CONFIG_MAXSMP is not set
+CONFIG_NR_CPUS_RANGE_BEGIN=2
+CONFIG_NR_CPUS_RANGE_END=512
+CONFIG_NR_CPUS_DEFAULT=64
+CONFIG_NR_CPUS=12
 CONFIG_SCHED_CLUSTER=y
 CONFIG_SCHED_SMT=y
 CONFIG_SCHED_MC=y
@@ -430,7 +430,7 @@
 # CONFIG_AMD_NUMA is not set
 CONFIG_X86_64_ACPI_NUMA=y
 # CONFIG_NUMA_EMU is not set
-CONFIG_NODES_SHIFT=10
+CONFIG_NODES_SHIFT=6
 CONFIG_ARCH_SPARSEMEM_ENABLE=y
 CONFIG_ARCH_SPARSEMEM_DEFAULT=y
 CONFIG_ARCH_PROC_KCORE_TEXT=y
@@ -4995,8 +4995,7 @@
 # CONFIG_DMA_MAP_BENCHMARK is not set
 CONFIG_SGL_ALLOC=y
 CONFIG_CHECK_SIGNATURE=y
-CONFIG_CPUMASK_OFFSTACK=y
-# CONFIG_FORCE_NR_CPUS is not set
+CONFIG_FORCE_NR_CPUS=y
 CONFIG_CPU_RMAP=y
 CONFIG_DQL=y
 CONFIG_GLOB=y
@@ -5150,6 +5149,8 @@
 # CONFIG_DEBUG_VIRTUAL is not set
 CONFIG_DEBUG_MEMORY_INIT=y
 # CONFIG_DEBUG_PER_CPU_MAPS is not set
+CONFIG_ARCH_SUPPORTS_KMAP_LOCAL_FORCE_MAP=y
+# CONFIG_DEBUG_KMAP_LOCAL_FORCE_MAP is not set
 CONFIG_HAVE_ARCH_KASAN=y
 CONFIG_HAVE_ARCH_KASAN_VMALLOC=y
 CONFIG_CC_HAS_KASAN_GENERIC=y


And I'm reporting from a freshly-rebuilt kernel, which succeeded in
booting.  So this was totally on me, I did not know about these
conflicts in my configuration.

Apologies on making noise about this panic.

Best regards,

-- 
Ricardo Nabinger Sanchez

    Dedique-se a melhorar seus esforços.
    Todas as suas conquistas evolutivas não foram resultado dos
    deuses, das outras consciências, ou do acaso, mas unicamente
    da sua transpiração. ---Waldo Vieira, Léxico de Ortopensatas

      parent reply	other threads:[~2023-06-13 21:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-13 19:56 panic in udp_init() when using FORCE_NR_CPUS Ricardo Nabinger Sanchez
2023-06-13 20:19 ` Eric Dumazet
2023-06-13 21:05   ` Eric Dumazet
2023-06-13 21:41     ` Ricardo Nabinger Sanchez
2023-06-13 21:22   ` Ricardo Nabinger Sanchez [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230613182215.33bfc5ef@espresso.lan.box \
    --to=rnsanchez@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=willemdebruijn.kernel@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).