From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 19DBB3BD224 for ; Thu, 28 May 2026 15:56:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779983789; cv=none; b=c2rNaAASygU0nrcmhl8mm2ROMDIs7ZX0wSCUF9eagxagurhe6qgAry95eO+C7WMKW8Q0/J+NwMFf8vmuu7fYgGixA2UnEZM5ihwZgHv4vQzvI67ZNh/7BtTx7YCJn8japhjZcdHgWp1otLQzjjJ9Uq3zGoKvUWL5lS+C/5C/d58= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779983789; c=relaxed/simple; bh=ANkxSz8Tk3QHceqjHTTrIz/1v4boDRUuV+QD/8sP0HI=; h=From:To:Cc:Subject:In-Reply-To:Date:Message-ID:References; b=PB4OELBMXgzsxpqpV/t7A8B0kwWFEsXYIHMnBYyqfT6X8BNrECNMgsz1Hq5q0Xgj4ZVE17J4uplpczl3tdNBzReGNoOo2JLPmicdXTTn76e0zqZmT8Qp3OQXNkGqeq3/n7U9FKeI4zT1dWw5aGlyAaXm3d5vKk1SF4piytaTqsU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=hr4Y3b/Y; arc=none smtp.client-ip=209.85.210.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hr4Y3b/Y" Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-8353fd1cb5fso6577847b3a.0 for ; Thu, 28 May 2026 08:56:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779983787; x=1780588587; darn=vger.kernel.org; h=references:message-id:date:in-reply-to:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=tZGnMBOtWKeFwwicE4ptN5y9cnUWMG4/NkvZPO2aUKs=; b=hr4Y3b/YiFvr5uxUfbv4SJyRnYR90IadT0Ifms42m4Y894HBm4GBjwZRSMl+3vrunT dp1d0JGJVjONiCs/fqCPbfkCb7VPcsbBfIOWQ7hQwh64ROWaZQATLREr0M9n/h/Prnd/ Rlta9JpTJv2bPpL2CHqnYMjEi4lI4N1Rtk7LFw7n9kS6ODLK9n8eUAF5aqUqzhrq16DY YHndkl5ncQkfCDROx+frELZwO5tcvaF/yUV+ljlUXZnzTtpgIVmf6tpHPxFS6OWCns// SaN2O60pKbHeF1Xhc++YL2p28XtLUIZMloGlDTGIOuDqVLCxjbWeRhNuBGwaaWLBSgkV 9IIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779983787; x=1780588587; h=references:message-id:date:in-reply-to:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=tZGnMBOtWKeFwwicE4ptN5y9cnUWMG4/NkvZPO2aUKs=; b=WF7jZH0NNf7QIrqoNo+nwaYWftJ6nIfn5uVh1BTbnHv3ZT9BnxAc/LW4ukfN+EYx7B Fv/L0/7ojxILjhQk6fqVKJXGFD7o/zq83gmPmigE2K8GAaGN0PiWIvjmFNqBA+zv5yOH SjxwKSXsJGS02e8/vZAk+FublOz7tXTJyKW7toi2DSO8ABQ+29AOkGcL7ZlL/C0MMIIE ZnHgkhbaBEgq2H3BH54B+7l3rsOEzYl8jAqR/4YDtgu3N/8KyDVfUrQWw0kUYeFNP/PX vC2Dw3l6LFglrg2mTOa0sDm/RblmIbnEXsBcqHzVm9QkYwXYqa+L0UG1HqWNAuC+ymt6 bm+Q== X-Forwarded-Encrypted: i=1; AFNElJ8UUgijhsnISCdwxS+aaEcsFIbR5Uc22wVqVSp07b6iqaFXU5Z22LST4YqkQBIotI5+eoFJlKDBByUF5H4=@vger.kernel.org X-Gm-Message-State: AOJu0YzAMnnXi34hXB6QSKevaCKa3CDH5xQGI2lWxnlhfZWhUH8NzfBU AEKvpqhF0sRq3H0lE9r8o01jrTlrLpteBtCohBLm/kICOLVf/G0X0Ow+ X-Gm-Gg: Acq92OG3pLdqeNDdVd6OLgYITOnUSPAmrQt6GrbMaY92MhKB7RKL6MVUJdMiDCJ8296 YL9P8qN8eRu0OjwuYtXAFDCEACQm7RZZ94HXBLRXwghAAxWfF78C4TkWYEJg21PH8dMqKJVt4te 5UXHvyLtiNiZ2MXiGebF5wbiCjH7IsexU2fIQlIzEIvqDVpidzl4S8x2fq9SKFguMNnzqFA18Ek auR/YY8rLXaIfEJ1ZJcyt0URWFIp+K3rerKV6SqV63Z8phBrxpGsYqioBrTZUp28NkDUEr1veEi /i6H3U7s9gSC2Q0ixwjn8YRan4uPq4qg5lQgUEHGtgoo6kn+jXz6ipO8GOl4aI6OqZhw+pleuWC xM2qqR4XxtnM4zsL1AOT00wyhMbb71+AahtHXRuc6j65CGVGoS/brT+g63Incwi6evh1/TwkuNI KccJhj/eyOb+IXiFg70BeBvyG7pdJAi/Uc X-Received: by 2002:a05:6a00:ab05:b0:82f:7762:3eb2 with SMTP id d2e1a72fcca58-841fe40a100mr1973612b3a.17.1779983787298; Thu, 28 May 2026 08:56:27 -0700 (PDT) Received: from pve-server ([49.205.216.49]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-841d70bb19asm5364984b3a.30.2026.05.28.08.56.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 May 2026 08:56:26 -0700 (PDT) From: Ritesh Harjani (IBM) To: Shrikanth Hegde , Venkat Rao Bagalkote , K Prateek Nayak , "Chen, Yu C" , Srikar Dronamraju , Ritesh Harjani Cc: Madhavan Srinivasan , "Christophe Leroy (CS GROUP)" , LKML , linuxppc-dev , Peter Zijlstra , tim.c.chen@linux.intel.com Subject: Re: [BUG] sched/cache: "Make LLC id continuous" causes NULL cpumask dereference in build_sched_domains on POWER9 In-Reply-To: <74a61427-b5d8-41ad-bc5b-508ee246d510@linux.ibm.com> Date: Thu, 28 May 2026 20:36:27 +0530 Message-ID: References: <51154de7-3700-4cb4-82f2-1b3a8fa427f7@linux.ibm.com> <74a61427-b5d8-41ad-bc5b-508ee246d510@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Shrikanth Hegde writes: > On 5/25/26 7:37 PM, Venkat Rao Bagalkote wrote: >> Greetings!!! >> >> I am seeing an early boot kernel panic due to NULL pointer dereference >> on a POWER9 (pSeries) system when testing linux-next (next-20260522). >> > > Hi Venkat, Ritesh, > Could you please try the below diff and see if it helps. > This helps to fix boot problem for SPLPAR for me. > > Hi Chenyu, > Let me know if I have to send the patch. Or > if you want to add more comments or change it feel free to pick it up and send it. > Either way is fine. Let me know. > > Hi Prateek, Srikar, > I hope the below diff makes sense. Please check. > > nit: llc_mask is still under CONFIG_SCHED_MC, for ppc it is set to true > always for SMP systems, and for others it is LLC domain. So not a concern i guess. > --- > > From 10e9413cef063446d67dc02c2b44e1ea582e5d53 Mon Sep 17 00:00:00 2001 > From: Shrikanth Hegde > Date: Thu, 28 May 2026 06:16:44 -0400 > Subject: [PATCH] topology: Provide arch_llc_mask for cache aware scheduling > > Venkat Reported a boot kernel panic next-20260522. Git bisect pointed to > b5ea300a17e3 ("sched/cache: Make LLC id continuous") > > Stacktrace points to llc_mask being null. > > NIP [c000000000e58504] _find_first_bit+0x44/0x130 > LR [c000000000e58500] _find_first_bit+0x40/0x130 > Call Trace: > build_sched_domains+0xad8/0xe50 > sched_init_smp+0xa8/0x164 > kernel_init_freeable+0x250/0x370 > ret_from_kernel_user_thread+0x14/0x1c > > On powerpc, cpu_coregroup_mask is available only when the underlying > hardware support coregroup. In shared LPAR, QEMU guest or power9 etc > coregroup isn;t supported. In such cases llc_mask was being referrenced > when it was null leading to panic. > > on powerpc, LLC is at SMT core level. So assumption that coregroup(MC) > domain point to LLC is wrong. Provide a way for archs to say where its > LLC is if it not at MC domain. > > Fixes: b5ea300a17e3 ("sched/cache: Make LLC id continuous") > Reported-by: Venkat Rao Bagalkote > Closes: https://lore.kernel.org/all/51154de7-3700-4cb4-82f2-1b3a8fa427f7@linux.ibm.com/ > Suggested-by: Chen, Yu C > Signed-off-by: Shrikanth Hegde > --- > arch/powerpc/include/asm/topology.h | 3 +++ > arch/powerpc/kernel/smp.c | 10 ++++++++++ > kernel/sched/topology.c | 9 +++++++++ > 3 files changed, 22 insertions(+) > I had to apply this change manually - as it wasn't cleanly applicable for me on linux-next. But since the changes were straight forward so it wasn't a problem. With this change I don't see the panic anymore, which I was observing earlier. Thanks for the quick fix. Feel free to add: Tested-by: Ritesh Harjani (IBM)