Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp316520lqb; Thu, 14 Mar 2024 12:02:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV/t83/wdL4mv48xUQ1tB3wzcUqhr4T2m3ojV14i9odzxPoaoS/cQNw2BzSYbbQNbLqMm9BMTPrwmjI2/cbk1V/ysoVyoxByhqSHX1B0A== X-Google-Smtp-Source: AGHT+IFlblK9bSqCGHm7A0x7XVGm/sJhH0m0tcUiv2qRghJHtkPkGC5+qyd0sxu/nB3Z4m3/kcnN X-Received: by 2002:a17:906:f894:b0:a46:3ce4:5acb with SMTP id lg20-20020a170906f89400b00a463ce45acbmr1924130ejb.75.1710442931064; Thu, 14 Mar 2024 12:02:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710442931; cv=pass; d=google.com; s=arc-20160816; b=NYNeTSWzV1k/dkX/aT6ObQK+Q372WeDP1A1dJ1BH+clj96rQLgC4xgbAIvPpiy2abz J2f4E0+GgYuXlT5gAQbmuMfsbs5UL0i9cOuDQgLKjTI/0FPJroVNoNj6rOFm+Xcm/wWi SVhHPxf4rrX4bA7OmOpOa9cjEab87KyfHf8/BwXT1RS2rmgV/ETijjukH1iyFQeOxkEy bfli1JZmhAEuC1SOT+fEwmhtldDUtmXLYiNtY0dk1k2QkJDfo1JgFfgwsWBkBJR011SS vPdPLbFGYL3dAWn58Yh5MzczV0SeepiNTzJk/g7AI8+1OBjPPcoBftcVRR5HS8xO3PSR FJCg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:feedback-id:dkim-signature; bh=toODvDUC/+WhYeLF1bUl1RzXkO/tMdgdcuyp40H3v8c=; fh=w4Y3gaGPViMOYzOYNVjnePYrdEruHtEIUkBG1oUnAgQ=; b=vRcRRFeo3+p2YJzZn5FJe5dvU59yIEPQZoJtlMIgz30+mJ3rpx/NObmFCTWBkP8Sk0 oMRgiKn6TGs74nIWW9SDRiqfV7n0BIr6nEMIQ0L1cUGcRVVB83xQIeRThIHyvgsQpRMs tTp3dwkkjrvlknXYaYoo2wuIkVHHAICF/0dMVT5UUtAvLfHgEsoylEjpLdI6M7g/apGy taPRDNDZ697cfOCxiLPky0nLIHaXx8OLYbUokK5tnwmbzB8/voPy0w/CM/eC2w9sFkoe tSoqbtlpX02jWjmlQXnxBxuejoWEhH3jr4AS45Vit6RtP03qlNSIFUvln0N4E0w6x5mV Lsug==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=IU6CQVt9; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-103694-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103694-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ho16-20020a1709070e9000b00a3e50678318si1020011ejc.238.2024.03.14.12.02.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 12:02:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-103694-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=IU6CQVt9; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-103694-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103694-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B7F7D1F211D6 for ; Thu, 14 Mar 2024 18:51:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7731174E26; Thu, 14 Mar 2024 18:51:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IU6CQVt9" Received: from mail-vs1-f47.google.com (mail-vs1-f47.google.com [209.85.217.47]) (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 9416271750; Thu, 14 Mar 2024 18:51:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.217.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710442305; cv=none; b=bv+FX92bYHzB0ybIedkTll2IUwNCmNbo/7ulHtrhB/NsIhi7owni5mPjiOLWi1DgFm2Ew2VHFWJHnKmbjZ/96dzzNdLs8SqzxuKW3irTNj/AYnyFFQRZy16k3mubOj4ylwkEZ959cHk+u5cjaw/C1zCihqfbgZ4iBzSIcwmsCEQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710442305; c=relaxed/simple; bh=8pgJmR+NuPGKwTI96hNmu9LNA5hPtV2MSHVAXlE93+I=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YQUzQ+L5ZsI3D1Xt5XYbl/CjaO4ik1U7P0W1VAhwpwXbfjso3EI4LfxfyA2hCiqARtXNfXQ5U65PEuSRI3wCsoitFdSFEpRmYUIM0bmDcvuCVVKPiVB3/E0V426sLIiMtbU5bC1nEhBGvyq/M5YtnIlaZ2AMBEFvTSK2Tckl54E= 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=IU6CQVt9; arc=none smtp.client-ip=209.85.217.47 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 Received: by mail-vs1-f47.google.com with SMTP id ada2fe7eead31-47310400a8dso327237137.1; Thu, 14 Mar 2024 11:51:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710442302; x=1711047102; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:from:to:cc:subject:date :message-id:reply-to; bh=toODvDUC/+WhYeLF1bUl1RzXkO/tMdgdcuyp40H3v8c=; b=IU6CQVt93U53BEmJvxn2Rk/ptq/Q+fNQh5a1L2+JipTEgVXWkBY3CwN7P8jSEFBp5h zgjinp+Dj7jS3SAldjrQIjXIhH9Cjqt+DNhqf1ebgtUHgXeMzpxSL16PyvFz7aPwWXDL lU7Ufsw8blvysLMC5XxbiYJes3vPRL5oVCT0VmSvWUmkEjqU1NrQh2wPPdLct1sej4lN sT/n4aG4so1uXWzDZBDfyLm6wn5nu3oiWZB+ka1fOEPO4v185AMN2zKeNRQPJ3vLbQ/o Jt30TWhtqcTLxvwTBTKdYSuWUxhU0frw4GBwvr3AEB575/8X0PuftqjEWdfZ6o7vsjyE fIog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710442302; x=1711047102; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=toODvDUC/+WhYeLF1bUl1RzXkO/tMdgdcuyp40H3v8c=; b=c8cxnkJ066MdUcgf/A/C0xozFJAzjQCUMib2KVCvLYn7fb6eXXsj6g+BWVmB4tmYol ulg1eRFLqfgskibyXDs6BBCO5mFN+LWUNRzP3tQjQV+XWZeAPLvaNnl/EtQ2gqTiI6CL UnTuOThoidOrWOnLP9Kzg5DPMxxSKPtWJ336wJt/48hYjMvildmyt5nrSG1f93+smFPg huxF90SKvikhVSadc63IuvoUdxM0+xqK1Gp4uKQf/3ZszDfTo2pIQhG2LE6s2o71+JWp ShYIshU0OGpa+vTH80S6RUa+oR/rsDg92cKyjz5x0s+L0mQwS9ne2n/7BgUawajFnlJz 1RhQ== X-Forwarded-Encrypted: i=1; AJvYcCXV9YtazCQw1YGxx6bpS89llv65TdAXruHr1jVowms8p2zkWaCOhROY5mfBoApxfPrR9EUb1HFmkPDajB7qVSMeLUxSDlcpH62jjiYox1abSe4r3nKdzJkQsSfBEC9UTYGG X-Gm-Message-State: AOJu0YybHZ4cOD9LsCZMC/FKhvd+ADmk5eWHHDbwFkPd5KNTC70obymZ H6t2iN2qITQ9g6uYQ4Sa7gk6UXNi0KcWx7Wfhzdt1cVqrl477hB7YW2A82Pe X-Received: by 2002:a05:6102:32c6:b0:474:c54c:67b1 with SMTP id o6-20020a05610232c600b00474c54c67b1mr1434964vss.0.1710442302207; Thu, 14 Mar 2024 11:51:42 -0700 (PDT) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com. [66.111.4.228]) by smtp.gmail.com with ESMTPSA id a9-20020a0562140c2900b0068f0ff36defsm803841qvd.47.2024.03.14.11.51.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 11:51:41 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailauth.nyi.internal (Postfix) with ESMTP id 2BF0527C0060; Thu, 14 Mar 2024 14:51:41 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 14 Mar 2024 14:51:41 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrjeejgdduudehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepuehoqhhu nhcuhfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrg htthgvrhhnpeffleejleehveelteeltedugffhhedvkefgvdehfeeiffeihfeigfdvtdeu hfdtteenucffohhmrghinhepkhgvrhhnvghlrdhorhhgpdhgihhthhhusgdrtghomhenuc evlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsohhquhhn odhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdeiledvgeehtdeigedqudejje ekheehhedvqdgsohhquhhnrdhfvghngheppehgmhgrihhlrdgtohhmsehfihigmhgvrdhn rghmvg X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 14 Mar 2024 14:51:39 -0400 (EDT) Date: Thu, 14 Mar 2024 11:51:34 -0700 From: Boqun Feng To: Florian Fainelli Cc: Frederic Weisbecker , "Russell King (Oracle)" , Joel Fernandes , Anna-Maria Behnsen , Linus Torvalds , linux-kernel@vger.kernel.org, kernel-team@meta.com, paulmck@kernel.org, mingo@kernel.org, tglx@linutronix.de, rcu@vger.kernel.org, neeraj.upadhyay@amd.com, urezki@gmail.com, qiang.zhang1211@gmail.com, bigeasy@linutronix.de, chenzhongjin@huawei.com, yangjihong1@huawei.com, rostedt@goodmis.org, Justin Chen Subject: Re: Unexplained long boot delays [Was Re: [GIT PULL] RCU changes for v6.9] Message-ID: References: <2fb110ed-ba04-4320-9ef0-8766c9df5578@gmail.com> <533151c9-afb5-453b-8014-9fbe7c3b26c2@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Mar 14, 2024 at 11:35:23AM -0700, Florian Fainelli wrote: > On 3/14/24 03:41, Frederic Weisbecker wrote: > > On Wed, Mar 13, 2024 at 08:44:07PM -0700, Florian Fainelli wrote: > > > > > > > > > On 3/13/2024 3:52 PM, Frederic Weisbecker wrote: > > > > On Wed, Mar 13, 2024 at 03:04:26PM -0700, Florian Fainelli wrote: > > > > > On 3/13/24 14:59, Russell King (Oracle) wrote: > > > > > > On Wed, Mar 13, 2024 at 02:30:43PM -0700, Florian Fainelli wrote: > > > > > > > I will try to provide multiple answers for the sake of everyone having the > > > > > > > same context. Responding to Linus' specifically and his suggestion to use > > > > > > > "initcall_debug", this is what it gave me: > > > > > > > > > > > > > > [ 6.970669] ata1: SATA link down (SStatus 0 SControl 300) > > > > > > > [ 166.136366] probe of unimac-mdio-0:01 returned 0 after 159216218 usecs > > > > > > > [ 166.142931] unimac-mdio unimac-mdio.0: Broadcom UniMAC MDIO bus > > > > > > > [ 166.148900] probe of unimac-mdio.0 returned 0 after 159243553 usecs > > > > > > > [ 166.155820] probe of f0480000.ethernet returned 0 after 159258794 usecs > > > > > > > [ 166.166427] ehci-brcm f0b00300.ehci_v2: EHCI Host Controller > > > > > > > > > > > > > > Also got another occurrence happening resuming from suspend to DRAM with: > > > > > > > > > > > > > > [ 22.570667] brcmstb-dpfe 9932000.dpfe-cpu: PM: calling > > > > > > > platform_pm_resume+0x0/0x54 @ 1574, parent: rdb > > > > > > > [ 181.643809] brcmstb-dpfe 9932000.dpfe-cpu: PM: > > > > > > > platform_pm_resume+0x0/0x54 returned 0 after 159073134 usecs > > > > > > > > > > > > > > and also with the PCIe root complex driver: > > > > > > > > > > > > > > [ 18.266279] brcm-pcie f0460000.pcie: PM: calling > > > > > > > brcm_pcie_resume_noirq+0x0/0x164 @ 1597, parent: platform > > > > > > > [ 177.457219] brcm-pcie f0460000.pcie: clkreq-mode set to default > > > > > > > [ 177.457225] brcm-pcie f0460000.pcie: link up, 2.5 GT/s PCIe x1 (!SSC) > > > > > > > [ 177.457231] brcm-pcie f0460000.pcie: PM: brcm_pcie_resume_noirq+0x0/0x164 > > > > > > > returned 0 after 159190939 usecs > > > > > > > [ 177.457257] pcieport 0000:00:00.0: PM: calling > > > > > > > pci_pm_resume_noirq+0x0/0x160 @ 33, parent: pci0000:00 > > > > > > > > > > > > > > Surprisingly those drivers are consistently reproducing the failures I am > > > > > > > seeing so at least this gave me a clue as to where the problem is. > > > > > > > > > > > > > > There were no changes to drivers/net/ethernet/broadcom/genet/, the two > > > > > > > changes done to drivers/net/mdio/mdio-bcm-unimac.c are correct, especially > > > > > > > the read_poll_timeout() conversion is correct, we properly break out of the > > > > > > > loop. The initial delay looked like a good culprit for a little while, but > > > > > > > it is not used on the affected platforms because instead we provide a > > > > > > > callback and we have an interrupt to signal the completion of a MDIO > > > > > > > operation, therefore unimac_mdio_poll() is not used at all. Finally > > > > > > > drivers/memory/brcmstb_dpfe.c also received a single change which is not > > > > > > > functional here (.remove function change do return void). > > > > > > > > > > > > > > I went back to a manual bisection and this time I believe that I have a more > > > > > > > plausible candidate with: > > > > > > > > > > > > > > 7ee988770326fca440472200c3eb58935fe712f6 ("timers: Implement the > > > > > > > hierarchical pull model") > > > > > > > > > > > > I haven't understood the code there yet, and how it would interact with > > > > > > arch code, but one thing that immediately jumps out to me is this: > > > > > > > > > > > > " As long as a CPU is busy it expires both local and global timers. When a > > > > > > CPU goes idle it arms for the first expiring local timer." > > > > > > > > > > > > So are local timers "armed" when they are enqueued while the cpu is > > > > > > "busy" during initialisation, and will they expire, and will that > > > > > > expiry be delivered in a timely manner? > > > > > > > > > > > > If not, this commit is basically broken, and would be the cause of the > > > > > > issue you are seeing. For the mdio case, we're talking about 2ms > > > > > > polling. For the dpfe case, it looks like we're talking about 1ms > > > > > > sleeps. I'm guessing that these end up being local timers. > > > > > > > > > > > > Looking at pcie-brcmstb, there's a 100ms msleep(), and then a polling > > > > > > for link up every 5ms - if the link was down and we msleep(5) I wonder > > > > > > if that's triggering the same issue. > > > > > > > > > > > > Why that would manifest itself on 32-bit but not 64-bit Arm, I can't > > > > > > say. I would imagine that the same hardware timer driver is being used > > > > > > (may be worth checking DT.) The same should be true for the interrupt > > > > > > driver as well. There's been no changes in that code. > > > > > > > > > > I just had it happen with ARM64 I was plagued by: > > > > > > > > > > https://lore.kernel.org/lkml/87wmqrjg8n.fsf@somnus/T/ > > > > > > > > > > and my earlier bisections somehow did not have ARM64 fail, so I thought it > > > > > was immune but it fails with about the same failure rate as ARM 32-bit. > > > > > > > > Can you please boot with: > > > > > > > > trace_event=timer_migration,timer_start,timer_expire_entry,timer_cancel > > > > > > > > And add the following and give us the resulting output in dmesg? > > > > > > Here are two logs from two different systems that exposed the problem on > > > boot: > > > > > > https://gist.github.com/ffainelli/f0834c52ef6320c9216d879ca29a4b81 > > > https://gist.github.com/ffainelli/dc838883edb925a77d8eb34c0fe95be0 > > > > Thanks! Unfortunately like Thomas pointed out, I'm missing the timer_migration > > events. My fault, can you retry with this syntax? > > > > trace_event=timer_migration:*,timer_start,timer_expire_entry,timer_cancel > > > > Though it's fairly possible that timer migration is not enabled at this point > > as it's a late initcall. But we better not miss its traces otherwise. > > Here is another log with timer_migration: > > https://gist.github.com/ffainelli/237a5f9928850d6d8900d1f36da45aee FWIW, the trace point is still not enabled: [ 0.000000] Failed to enable trace event: timer_migration:* you need this commit in master: 36e40df35d2c "timer_migration: Add tracepoints" , which is one commit later than 7ee988770326 AFAICT Regards, Boqun > -- > Florian >