From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=217.194.8.81 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796215622; b=pY3SRGyzYw8LquBTZ60EedcquPWdd2tEyHL01QdR/ForrdcNk7Zxf2HcKPrKDFgSprHN FrtxmE63MfavbiSX0shlybg3d6tFKrb6U0m1l8QdHcfACfK7yaUlO0BSy20CHir5IQtAl OSCYC0xrLDoBQ3cBb9yWxiMUbqxfsruityCpePRtWZPsCGGMt8erANy3mxoFncXLkRIsH ltdwUdPk6c5rIBUeXLPrkVXtmbqNtNSocSOFUPRXtdIKpnTE/kjSk3isu0oVHo2GdVqCm vgW5UNpfMQnr0j8vQ8o2cKHrkrbsO19hWPcS6fI2yIfiMEgSMHzV5d0bCNHgIXP0jWA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796215622; h=DMARC-Filter:Received:DKIM-Signature:Date:From:To:Cc:Subject: Message-ID:References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To; bh=gV0KDl4gfvN7umYMPJ62Ng6R6wmiFgp/EsapaGRAOTc=; b=k+n+4o2xe+No2GMs87rcHInp/gCmUQcpnx/FtBK4G0SNAUI4zA0ap/S4Nowu671FwNOd 6d3bRhZ6GYUsp/CXqSFi/VYbpUGjCuj8SKeJvnsQrS8oHQpV2v7y80Mc7627Vf4FkEGRJ Ft6yiW45tfQM8AmcgWX4o1XeEcTFhzlHPh2GdbzuVXKSk+JlBbPBSCn34UPsNZFZZ5nTL YYfpO7eF7l/ozL69Nb3up0pi2dLUmnuIOFbka5gREWvE0bjGxPzQWhvnz9r43P3lvv6CL 84Z/gp3qAjCUy53J94bVPZnotVQ1FreAIVIbYrp9u6SMOI5jGA6DNRQxYp50e9sMaiQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=dolcini.it; spf=pass smtp.mailfrom=dolcini.it; dkim=pass header.d=dolcini.it header.i=@dolcini.it header.a=rsa-sha256 header.s=default header.b=LhLKLHSj; arc=none smtp.remote-ip=217.194.8.81 Received: from mail11.truemail.it (mail11.truemail.it [217.194.8.81]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D7A4F606A31A; Wed, 2 Dec 2026 12:46:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D7A4F606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=dolcini.it Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=dolcini.it Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=dolcini.it header.i=@dolcini.it header.a=rsa-sha256 header.s=default header.b=LhLKLHSj Received: from francesco-nb (93-49-2-63.ip317.fastwebnet.it [93.49.2.63]) by mail11.truemail.it (Postfix) with ESMTPA id D57E6201AD; Wed, 2 Dec 2026 13:46:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dolcini.it; s=default; t=1796215611; bh=gV0KDl4gfvN7umYMPJ62Ng6R6wmiFgp/EsapaGRAOTc=; h=From:To:Subject; b=LhLKLHSj0XHN9z28Pgf7/n+c7GMLNLYzsWAaNnNB+1+3VVQgh/1avDjtyD1UBJa+T Oaui+2Q8Wdmq6K7Pe2RxKrlxzceaAKSXXJZDyR1OH0efQAKhmM1cqfIzq0qvdaaZmK zY3DOVbn8lMLtejUMeH0taW1xc8XcMeme9aj18IPZst6ZozZ8dwxc4T6ucHWgtxrP5 O8PqmV6zo1ju4MTGjgkqJwRCHH07atNFjQgUY7OLAbYJfNS9GDSxE4uqm8ewqZUJDZ MmZYoiXphNdCxC2Aj5KvRxGP382hOv7a4HZFXHCJJavLvdJKVe3m3E+GizeIiswwxA TdBluGX0IAl2g== Date: Wed, 2 Dec 2026 13:46:47 +0100 From: Francesco Dolcini To: Peng Fan Cc: Francesco Dolcini , Francesco Dolcini , Sebastian Andrzej Siewior , Peng Fan , Peng Fan , linux-remoteproc@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-rt-devel@lists.linux.dev, Bjorn Andersson , Clark Williams , Fabio Estevam , Frank Li , Jassi Brar , Mathieu Poirier , Pengutronix Kernel Team , Sascha Hauer , Steven Rostedt Subject: Re: [PATCH v3 00/10] mailbox: imx: Use threaded handler to avoid kworker in imx's remoteproc Message-ID: <20261202124647.GA59686@francesco-nb> References: <20261116102331.K8Sc86V9@linutronix.de> <20261119114041.GA166708@francesco-nb> X-Mailing-List: linux-rt-devel@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Hello Peng, On Thu, Nov 26, 2026 at 04:16:10PM +0800, Peng Fan wrote: > On Thu, Nov 19, 2026 at 03:44:17PM +0100, Francesco Dolcini wrote: > >On Thu, Nov 19, 2026 at 10:30:06PM +0800, Peng Fan wrote: > >> On Thu, Nov 19, 2026 at 12:40:41PM +0100, Francesco Dolcini wrote: > >> >Hello Peng, Sebastian > >> > > >> >On Mon, Nov 16, 2026 at 11:23:31AM +0100, Sebastian Andrzej Siewior wrote: > >> >> On 2026-11-16 10:23:41 [+0100], Francesco Dolcini wrote: > >> >> > Our CI shows a ~10-15% eMMC sequential read throughput drop on i.MX8QXP > >> >> > and i.MX8DX (Colibri iMX8X, Cortex-A35), starting with v7.2-rc1 and > >> >> > still present in v7.4-rc3 (hdparm --direct -t: ~129 MB/s -> 105-120 > >> >> > MB/s on i.MX8DX). i.MX8QM, i.MX8M and i.MX9 are not affected. > >> >> > > >> >> > 5d1c0000.mailbox interrupt count before the test went from ~8k on v6.18 > >> >> > to 60k+ on v7.3/v7.4. > >> >> > > >> >> > Peng: any idea/suggestion? Does it makes any sense to you? > >> >> > >> >> Can you pin point it to a patch in this series? My guess is that > >> >> something with the masking/ unmasking went wrong. The increase might be > >> >> result of the interrupt keeping firing while the threaded interrupt did > >> >> not have a chance to run. > >> > > >> >Reverting 36cac4b5101f, 3225a745f517, e55bea377d49 and 692e1bc96a5d > >> >restores 149 MB/s with schedutil. > >> > > >> > > >> >On Thu, Nov 19, 2026 at 02:25:55PM +0800, Peng Fan wrote: > >> >> On Mon, Nov 16, 2026 at 10:23:41AM +0100, Francesco Dolcini wrote: > >> >> >Peng: any idea/suggestion? Does it makes any sense to you? > >> >> > >> >> Please help test whether this helps: > >> >> > >> >> diff --git a/drivers/mailbox/imx-mailbox.c b/drivers/mailbox/imx-mailbox.c > >> >> index 683ccea6f2ba..e29044cf4b92 100644 > >> >> --- a/drivers/mailbox/imx-mailbox.c > >> >> +++ b/drivers/mailbox/imx-mailbox.c > >> >> @@ -635,7 +635,7 @@ static int imx_mu_startup(struct mbox_chan *chan) > >> >> { > >> >> struct imx_mu_priv *priv = to_imx_mu_priv(chan->mbox); > >> >> struct imx_mu_con_priv *cp = chan->con_priv; > >> >> - unsigned long irq_flag = IRQF_NO_THREAD; > >> >> + unsigned long irq_flag = IRQF_NO_THREAD | IRQF_ONESHOT; > >> >> int ret; > >> >> > >> >> pm_runtime_get_sync(priv->dev); > >> > > >> >It does not help. > >> > > >> >The analysis below was done with Claude help, on measurements I took on a > >> >Colibri iMX8QXP. I hope you can pick it up from there, this is not my > >> >area of expertise, and the best I can do is to send a revert for those 4 > >> >commits. > >> > > >> >Every SCU RPC now wakes the SCHED_FIFO irq thread (TX done and RX), and > >> >while an RT task is runnable schedutil requests the maximum CPU frequency. > >> >The A35 clock is CLK_GET_RATE_NOCACHE, so each frequency change is > >> >followed by an SCU RPC reading the rate back, which wakes the irq thread > >> >again. The loop never settles, even when idle, and the transitions (ATF + > >> >SCU) are what costs the eMMC throughput (and I assume there is more > >> >impact on performance than just this). > >> > >> Not sure whether this is root cause, per my understanding, cpu freq update > >> is not that high frequency call. > > > >Moving to `performance` from `schedutil` or reverting those 4 patches > >solve the issue. And the significant increase on ctx switches and irq > >count is real even on idle without any emmc test running. > > > >> Let me setup a i.MX8QXP board and see what's going on there. > >Thanks! > > > >> BTW, i.MX8QM should > >> also have same issue, but seems not impact in your report, a bit werid, > >> might be because i.MX8QM has more cores :) > > > >I agree, I did not run any kind of extensive performance test. What > >happened is just that our emmc test started to fail, and this lead to > >this series. > > > >> Have you tried pin your emmc test thread to core3, or core2, just not core0. > > > >It was never pinned to any core, so the scheduler decided on its own. > >And multiple runs of the test all lead to the same results. > > My test on i.MX8QXP-MEK does not show interrupt increasing a lot, ignore the rootfs name. Thanks a lot for testing, appreciated. No idea what's going on, there were some scheduler related changes at some point, maybe you tested with a later version that includes those changes. I'll try to get some more data in the next days, running on the upcoming 7.4-rc6, on QXP and also on the dual variant, and I'll update this thread with my findings. Francesco