From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF831C54E67 for ; Thu, 14 Mar 2024 13:17:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 53738800A5; Thu, 14 Mar 2024 09:17:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4E6DD80073; Thu, 14 Mar 2024 09:17:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3AE7B800A5; Thu, 14 Mar 2024 09:17:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 2CC8680073 for ; Thu, 14 Mar 2024 09:17:36 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id C100280165 for ; Thu, 14 Mar 2024 13:17:35 +0000 (UTC) X-FDA: 81895696470.30.956A3EF Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) by imf30.hostedemail.com (Postfix) with ESMTP id DC6CD80026 for ; Thu, 14 Mar 2024 13:17:32 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=armlinux.org.uk header.s=pandora-2019 header.b=ho7CTE2Z; dmarc=pass (policy=none) header.from=armlinux.org.uk; spf=none (imf30.hostedemail.com: domain of "linux+linux-mm=kvack.org@armlinux.org.uk" has no SPF policy when checking 78.32.30.218) smtp.mailfrom="linux+linux-mm=kvack.org@armlinux.org.uk" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1710422253; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=clrW0RwMW19aCCVUBe+aDaa6Xr2fikUQUzGV0E47Ik8=; b=7N9PMisNydm+u8hYRPTLYMlFlfQ/eu8SadyS3KZBiRdqxiHX0MpRjcqcYpSXGflYFXii78 COio4cVed6qkW9i9NKN8PXOdw+LowT7LUWw1yW61eWk3F1isglQaiHkbl8MBmVFYozhKCQ YnR4Ws1WV3WOlVKK3Z0omqtGiWz0KkA= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=armlinux.org.uk header.s=pandora-2019 header.b=ho7CTE2Z; dmarc=pass (policy=none) header.from=armlinux.org.uk; spf=none (imf30.hostedemail.com: domain of "linux+linux-mm=kvack.org@armlinux.org.uk" has no SPF policy when checking 78.32.30.218) smtp.mailfrom="linux+linux-mm=kvack.org@armlinux.org.uk" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1710422253; a=rsa-sha256; cv=none; b=tn0+dSV06FDIs8SL28yfsQHQpPJQCwAH1Pak9oCxca5fDKpPm8h40fmJwkUeqCJW1d4hMB uICxPluC3tHc/+LAIcVun4UqyQC/8R+hIdOrxL7JWgkp0sCnE9A/TPZXIWCZEYmM1BqOeU e4srxu2IPICtgDx5nkdbGp6r3kSMCus= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=clrW0RwMW19aCCVUBe+aDaa6Xr2fikUQUzGV0E47Ik8=; b=ho7CTE2Zq1/DvHgOQchZ4l3JtQ k5ID2n2/S4kvmPPE9WrMgxAyc9pWgcLyPizYsqSRtd8W80gi8AYct3bRILrT6ln668Tj9Q8FWDx3G uEh81hiCaDn+Kr+6bcuNb1RRA9E0Rs2P51cwzTON2R++WbCGz+BSSutYfuA4BjFKr7/houpCIGZmz Q1km00FJT9ueKsGXmjsYD9euNplW3zJK4EkHBw5g5tQmR0YA21vrtJxeVxuiP0G9UdTakINVDCKR/ iMmP0znPoqK9WArfjueEljzbfOI+lNl4mY7UMH924GL2vKcYY7lNEZ7Ekj2uCbUneYA9wSFamyc+E jgzW8UBQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:51784) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rkkxM-0000Vg-2h; Thu, 14 Mar 2024 13:17:12 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rkkxE-0005Tc-6M; Thu, 14 Mar 2024 13:17:04 +0000 Date: Thu, 14 Mar 2024 13:17:04 +0000 From: "Russell King (Oracle)" To: Marek Szyprowski Cc: Catalin Marinas , Sudeep Holla , "Christoph Lameter (Ampere)" , Mark Rutland , "linux-pm@vger.kernel.org" , "Rafael J. Wysocki" , Viresh Kumar , Will Deacon , Jonathan.Cameron@huawei.com, Matteo.Carlini@arm.com, Valentin.Schneider@arm.com, akpm@linux-foundation.org, anshuman.khandual@arm.com, Eric Mackay , dave.kleikamp@oracle.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, robin.murphy@arm.com, vanshikonda@os.amperecomputing.com, yang@os.amperecomputing.com, Nishanth Menon , Stephen Boyd Subject: Re: [PATCH v3] ARM64: Dynamically allocate cpumasks and increase supported CPUs to 512 Message-ID: References: <9352f410-9dad-ac89-181a-b3cfc86176b8@linux.com> <432c1980-b00f-4b07-9e24-0bec52ccb5d6@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Rspamd-Queue-Id: DC6CD80026 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: yx8yayqak61781q8jxh4tx4igx59zt5k X-HE-Tag: 1710422252-728361 X-HE-Meta: U2FsdGVkX19Fg9iqCpbZBGe4TeE7DGo7WfGxWIoy+yh6F6HhqPrdR7QHKjV3Y43ry+5ZSkqOhSrKVSm21BXHN+pmzVnrjCUoMJ3RCa6jeD8O6OgevzNuusIARqIJnwSosKaR2pbHQqGHrmQA5RpEvpjBkY45PJtAXq9Q8h9wnb5ucFAxmmslYRGeBR91rGdm3+RR3yANpOKSU2+2JYnvw9vkMbOGSBaTXkEd2a3qJaSjmthzxOLY81rP2RU9SaQp3+xu/Dume88HTWhCZwCBrJsVhOTaUDVN6uOuSIFVCFwdc/mrU0bxF3H6c66NqZ3AZM8mLX3bskUrLe655euYojx3QMcuoW8fJTkf0yfKjoYbiE6bF/HpaApLm+J/KPdRzhTNWPc1/uYC5ukJoKjBx8dsymqqYwcsuXgTsVAYBrMBKS9iWHzeYqwviTKVErYSxkJInFsVDnQQjCnak3NuzA/R/EbuO0Z7VoSa1SVD2JYyn69CFCOrgI5flUght5BUo7jKuEy6MV9hMc4ShCG5ol0nXak9dUPDAuidfBAg3kpMID1jcxwHzg+uq14mJC+f6WSaU4mkdiXCZT08fIX9PK2zvgFXGQb1OAHpGgpWYIKRXOV3omQtU8/xmSZSn0j7aZ3pe89EeQkyFeEi95YWvdaWTcQQI9R+GHfOy13N+iv/4AjLOwfspV8WfKgriPfNPkbbPp2DLd01H+UmME7VTmpim2n8OjM7TQo+2c9Eg6QM+nDpql3nxp1W1U8Mp1DSofAuZOl4IKcChdtzKmt2JRtjVmst20qGOZ0CSxLCXGbEZ+Ous/mHcRBhgXiAg9RN14Z3YKHb6h4Eq59WqCG9O+ZLyGgb66UGlBPv3SBrO4PFga1Hpx+Tw0GqNlRTdbYD5jrM+NAlxZc3TAAGzqOK1cBG7d+ixi0MgCT5D0gqe47GGoz1lQBtkySma/ri1Ag9XZChmtH3vNXd1aOy4UL w0pFIzP5 HcLuQ6Bm8WT8i65MkUee/l6Dpkd4sEbcEDkgFHerAepw7gcqy1N0rk4j7rBlhSb+7I+lYx1yQ8mwG75pTPeip872F0lDuLOb3L62HIpdlXbwg5iK+9pVvAw/ADqBnYxXdBEcx6wvn6T2/LZAjvnkvbpu5mLN93BWD85WYuadskEcEtcjcLjBrItce5nKuvaSb1PG3ub1b6YAIvgtq5Syr6v6qc3E3ePXt93zdW7VoLy/UwRyA3CO5Smd01/Sws3wkRJYt2AVuAIBqyAr2X6pEI/7ut9MCIMhyTz6ImPGtuFMQ1mbe+kphxHPMjpdEIyIROJj5BVGuLa6UkY8JLgNbMNAXaw6wRV/Z0LMmZt/ADUSWqST6FYVxEOp/ds+uyDqwx25RvO419W41XOP74RG9fV2py/xSMTVjFeeP4GdGGFH0c3dIxVVMIL/XUoS61i5Ieu1/tSvyUKjp+JM0a1+WRW4OiPfOZN0H6tq7sCydzhbazKaQMA4Fj41yNw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu, Mar 14, 2024 at 01:28:40PM +0100, Marek Szyprowski wrote: > Dear All, > > On 14.03.2024 09:39, Catalin Marinas wrote: > > On Wed, Mar 13, 2024 at 05:13:33PM +0000, Russell King wrote: > >> So, I wonder whether what you're seeing is a latent bug which is > >> being tickled by the presence of the CPU masks being off-stack > >> changing the kernel timing. > >> > >> I would suggest the printk debug approach may help here to see when > >> the OPPs are begun to be parsed, when they're created etc and their > >> timing relationship to being used. Given the suspicion, it's possible > >> that the mere addition of printk() may "fix" the problem, which again > >> would be another semi-useful data point. > > It might be an init order problem. Passing "initcall_debug" on the > > cmdline might help a bit. > > > > It would also be useful in dev_pm_opp_set_config(), in the WARN_ON > > block, to print opp_table->opp_list.next to get an idea whether it looks > > like a valid pointer or memory corruption. > > I've finally found some time to do the step-by-step printk-based > debugging of this issue and finally found what's broken! > > Here is the fix: > > diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c > index 8bd6e5e8f121..2d83bbc65dd0 100644 > --- a/drivers/cpufreq/cpufreq-dt.c > +++ b/drivers/cpufreq/cpufreq-dt.c > @@ -208,7 +208,7 @@ static int dt_cpufreq_early_init(struct device *dev, > int cpu) >         if (!priv) >                 return -ENOMEM; > > -       if (!alloc_cpumask_var(&priv->cpus, GFP_KERNEL)) > +       if (!zalloc_cpumask_var(&priv->cpus, GFP_KERNEL)) >                 return -ENOMEM; > >         cpumask_set_cpu(cpu, priv->cpus); > > > It is really surprising that this didn't blow up for anyone else so > far... This means that the $subject patch is fine. Wow. I guess we've been lucky with that allocation hitting memory containing zeros. Well done at tracking it down! -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!