From: K Prateek Nayak <kprateek.nayak@amd.com>
To: Borislav Petkov <bp@alien8.de>
Cc: linux-kernel@vger.kernel.org, linux-tip-commits@vger.kernel.org,
Leon Romanovsky <leon@kernel.org>,
Valentin Schneider <vschneid@redhat.com>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
Steve Wahl <steve.wahl@hpe.com>,
x86@kernel.org
Subject: Re: [tip: sched/urgent] sched/fair: Use sched_domain_span() for topology_span_sane()
Date: Fri, 4 Jul 2025 17:16:44 +0530 [thread overview]
Message-ID: <c3e97fe5-f058-4958-8660-a661f6a662a3@amd.com> (raw)
In-Reply-To: <20250704102103.GAaGerDxWX7VhePA3j@fat_crate.local>
Hello Boris,
On 7/4/2025 3:51 PM, Borislav Petkov wrote:
> On Fri, Jul 04, 2025 at 09:13:16AM -0000, tip-bot2 for K Prateek Nayak wrote:
>> The following commit has been merged into the sched/urgent branch of tip:
>>
>> Commit-ID: 02bb4259ca525efa39a2531cb630329fb87fc968
>> Gitweb: https://git.kernel.org/tip/02bb4259ca525efa39a2531cb630329fb87fc968
>> Author: K Prateek Nayak <kprateek.nayak@amd.com>
>> AuthorDate: Mon, 30 Jun 2025 06:10:59
>> Committer: Peter Zijlstra <peterz@infradead.org>
>> CommitterDate: Fri, 04 Jul 2025 10:35:56 +02:00
>>
>> sched/fair: Use sched_domain_span() for topology_span_sane()
>
> My guest doesn't like this one and reverting it ontop of the whole tip lineup
> fixes it.
>
> Holler for more data if needed.
In an attempt to solve a complicated case, I think I overlooked the
simplest one. In your case, the PKG and NODE domain should have same
span (and covers all the CPUs in the system) and the
build_sched_domain() loop skips building the NODE domain altogether
since PKG has all the online CPUs.
Can you try the below incremental diff on top of this patch and
let me know if you still hit the error:
(Lightly tested on QEMU)
diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
index 0e46068acb0a..cce540fe36c6 100644
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -2423,6 +2423,14 @@ static bool topology_span_sane(const struct cpumask *cpu_map)
struct cpumask *sd_span = sched_domain_span(sd);
int id;
+ /*
+ * If the child already covers the cpumap, sd
+ * remains un-initialized. Use sd->private to
+ * detect uninitialized domains.
+ */
+ if (!sd->private)
+ continue;
+
/* lowest bit set in this mask is used as a unique id */
id = cpumask_first(sd_span);
---
Thank you for the report and sorry for the oversight. Hope I have not
disrupted your Feierabend.
P.S. I'm used the below cmdline to reproduce this:
sudo ~/dev/qemu/build/qemu-system-x86_64 -enable-kvm -cpu host -m 20G \
-smp cpus=10,socket=1,thread=10 -machine q35 \
-object memory-backend-ram,size=20G,id=m0 \
-numa node,cpus=0-9,memdev=m0,nodeid=0 \
...
>
> [ 0.280062] Timer migration: 2 hierarchy levels; 8 children per group; 2 crossnode level
> [ 0.282922] NMI watchdog: Enabled. Permanently consumes one hw-PMU counter.
> [ 0.287572] smp: Bringing up secondary CPUs ...
> [ 0.288623] smpboot: x86: Booting SMP configuration:
> [ 0.289085] .... node #0, CPUs: #1 #2 #3 #4 #5 #6 #7 #8 #9 #10 #11 #12 #13 #14 #15
> [ 0.302358] smp: Brought up 1 node, 16 CPUs
> [ 0.304445] smpboot: Total of 16 processors activated (118401.12 BogoMIPS)
> [ 0.307884] BUG: unable to handle page fault for address: 0000000089c402fb
> [ 0.307884] #PF: supervisor read access in kernel mode
> [ 0.307884] #PF: error_code(0x0000) - not-present page
> [ 0.307884] PGD 0 P4D 0
> [ 0.307950] Oops: Oops: 0000 [#1] SMP NOPTI
> [ 0.308344] CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.16.0-rc4+ #1 PREEMPT(full)
> [ 0.309115] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 2023.11-8 02/21/2024
> [ 0.309934] RIP: 0010:build_sched_domains+0x627/0x1550
> [ 0.310086] Code: 84 75 06 00 00 f3 48 0f bc c0 48 63 f8 89 c0 48 0f a3 05 c4 cf 95 08 0f 83 6c 06 00 00 48 8b 3c fd c0 db 29 82 49 8b 44 24 18 <48> 8b 04 07 48 8b 80 90 00 00 00 48 33 86 90 00 00 00 66 85 c0 0f
> [ 0.310086] RSP: 0018:ffffc9000001fe60 EFLAGS: 00010247
> [ 0.310086] RAX: ffffffff89c402f8 RBX: ffff88800cea8e40 RCX: 0000000000000001
> [ 0.310086] RDX: ffffffffffffffff RSI: ffff88800ceaacc0 RDI: 0000000100000003
> [ 0.310086] RBP: ffff88800cc4e3e0 R08: 0000000000000000 R09: 0000000000000000
> [ 0.310086] R10: 00000000fffedb1d R11: 00000000fffedb1d R12: ffff88800ceda4c0
> [ 0.310086] R13: ffff88800cea9500 R14: 0000000000000010 R15: 000000000000000f
> [ 0.310086] FS: 0000000000000000(0000) GS:ffff8880f39f2000(0000) knlGS:0000000000000000
> [ 0.310086] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [ 0.310086] CR2: 0000000089c402fb CR3: 0000000002c1a000 CR4: 00000000003506f0
> [ 0.310086] Call Trace:
> [ 0.310086] <TASK>
> [ 0.310086] ? sched_init_domains+0x58/0xa0
> [ 0.310086] sched_init_smp+0x29/0x90
> [ 0.310086] kernel_init_freeable+0xa3/0x290
> [ 0.310086] ? __pfx_kernel_init+0x10/0x10
> [ 0.310086] kernel_init+0x1a/0x1c0
> [ 0.310086] ret_from_fork+0x85/0xf0
> [ 0.310086] ? __pfx_kernel_init+0x10/0x10
> [ 0.310086] ret_from_fork_asm+0x1a/0x30
> [ 0.310086] </TASK>
> [ 0.310086] Modules linked in:
> [ 0.310086] CR2: 0000000089c402fb
> [ 0.310086] ---[ end trace 0000000000000000 ]---
> [ 0.310086] RIP: 0010:build_sched_domains+0x627/0x1550
> [ 0.310086] Code: 84 75 06 00 00 f3 48 0f bc c0 48 63 f8 89 c0 48 0f a3 05 c4 cf 95 08 0f 83 6c 06 00 00 48 8b 3c fd c0 db 29 82 49 8b 44 24 18 <48> 8b 04 07 48 8b 80 90 00 00 00 48 33 86 90 00 00 00 66 85 c0 0f
> [ 0.310086] RSP: 0018:ffffc9000001fe60 EFLAGS: 00010247
> [ 0.310086] RAX: ffffffff89c402f8 RBX: ffff88800cea8e40 RCX: 0000000000000001
> [ 0.310086] RDX: ffffffffffffffff RSI: ffff88800ceaacc0 RDI: 0000000100000003
> [ 0.310086] RBP: ffff88800cc4e3e0 R08: 0000000000000000 R09: 0000000000000000
> [ 0.310086] R10: 00000000fffedb1d R11: 00000000fffedb1d R12: ffff88800ceda4c0
> [ 0.310086] R13: ffff88800cea9500 R14: 0000000000000010 R15: 000000000000000f
> [ 0.310086] FS: 0000000000000000(0000) GS:ffff8880f39f2000(0000) knlGS:0000000000000000
> [ 0.310086] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [ 0.310086] CR2: 0000000089c402fb CR3: 0000000002c1a000 CR4: 00000000003506f0
> [ 0.310086] note: swapper/0[1] exited with irqs disabled
> [ 0.310091] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009
> [ 0.311130] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009 ]---
>
--
Thanks and Regards,
Prateek
next prev parent reply other threads:[~2025-07-04 11:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-30 6:10 [PATCH v2] " K Prateek Nayak
2025-06-30 14:39 ` Steve Wahl
2025-07-03 16:00 ` Valentin Schneider
2025-07-04 9:13 ` [tip: sched/urgent] " tip-bot2 for K Prateek Nayak
2025-07-04 10:21 ` Borislav Petkov
2025-07-04 10:32 ` Peter Zijlstra
2025-07-04 11:46 ` K Prateek Nayak [this message]
2025-07-04 12:33 ` Borislav Petkov
2025-07-07 3:26 ` K Prateek Nayak
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=c3e97fe5-f058-4958-8660-a661f6a662a3@amd.com \
--to=kprateek.nayak@amd.com \
--cc=bp@alien8.de \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=steve.wahl@hpe.com \
--cc=vschneid@redhat.com \
--cc=x86@kernel.org \
/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
all inboxes | Powered by JetHome®