From: "Petr Tesařík" <petr@tesarici.cz>
To: "Linux regression tracking (Thorsten Leemhuis)"
<regressions@leemhuis.info>, Eric Dumazet <edumazet@google.com>
Cc: Linux regressions mailing list <regressions@lists.linux.dev>,
"David S. Miller" <davem@davemloft.net>,
Paolo Abeni <pabeni@redhat.com>, Jakub Kicinski <kuba@kernel.org>,
Jisheng Zhang <jszhang@kernel.org>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
Jose Abreu <joabreu@synopsys.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Chen-Yu Tsai <wens@csie.org>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Samuel Holland <samuel@sholland.org>,
"open list:STMMAC ETHERNET DRIVER" <netdev@vger.kernel.org>,
"moderated list:ARM/STM32 ARCHITECTURE"
<linux-stm32@st-md-mailman.stormreply.com>,
"moderated list:ARM/STM32 ARCHITECTURE"
<linux-arm-kernel@lists.infradead.org>,
open list <linux-kernel@vger.kernel.org>,
"open list:ARM/Allwinner sunXi SoC support"
<linux-sunxi@lists.linux.dev>,
Marc Haber <mh+netdev@zugschlus.de>, Andrew Lunn <andrew@lunn.ch>,
Florian Fainelli <f.fainelli@gmail.com>,
stable@vger.kernel.org, alexis.lothore@bootlin.com,
Guenter Roeck <linux@roeck-us.net>
Subject: Re: [PATCH net v3] net: stmmac: protect updates of 64-bit statistics counters
Date: Wed, 6 Mar 2024 11:03:12 +0100 [thread overview]
Message-ID: <20240306110312.04ddcde3@meshulam.tesarici.cz> (raw)
In-Reply-To: <20240306100153.32d305f7@meshulam.tesarici.cz>
On Wed, 6 Mar 2024 10:01:53 +0100
Petr Tesařík <petr@tesarici.cz> wrote:
> On Wed, 6 Mar 2024 09:23:53 +0100
> "Linux regression tracking (Thorsten Leemhuis)" <regressions@leemhuis.info> wrote:
>
> > On 28.02.24 12:03, Petr Tesařík wrote:
> > > On Wed, 28 Feb 2024 07:19:56 +0100
> > > "Linux regression tracking (Thorsten Leemhuis)" <regressions@leemhuis.info> wrote:
> > >
> > >> Net maintainers, chiming in here, as it seems handling this regression
> > >> stalled.
> > > Indeed, I was too busy with sandbox mode...
> >
> > Hmm, no reply in the past week to Petr's request for help from someone
> > with more knowledge about the field. :-/
> >
> > So I guess this means that this won't be fixed for 6.8? Unfortunate, but
> > well, that's how it it sometimes.
>
> For the record, I _can_ reproduce lockdep splats on my device, but they
> don't make any sense to me. They seem to confirm Jisheng Zhang's
> conclusion that lockdep conflates two locks which should have different
> lock-classes.
>
> So far I have noticed only one issue: the per-cpu syncp's are not
> initialized. I'll recompile and see if that's what confuses lockdep.
That wasn't the issue. FTR the syncp was in fact initialized, because
devm_netdev_alloc_pcpu_stats() is a macro that also takes care of the
initialization of the syncp struct field.
The problem is u64_stats_init().
Commit 9464ca650008 ("net: make u64_stats_init() a function") changed
it to an inline function. But that's wrong. It uses seqcount_init(),
which in turn declares:
static struct lock_class_key __key;
This assumes that each lock gets its own instance. But if
u64_stats_init() is a function (albeit an inline one), all calls
within the same file end up using the same instance.
Eric, would it be OK to revert the above-mentioned commit?
Petr T
WARNING: multiple messages have this Message-ID (diff)
From: "Petr Tesařík" <petr@tesarici.cz>
To: "Linux regression tracking (Thorsten Leemhuis)"
<regressions@leemhuis.info>, Eric Dumazet <edumazet@google.com>
Cc: Linux regressions mailing list <regressions@lists.linux.dev>,
"David S. Miller" <davem@davemloft.net>,
Paolo Abeni <pabeni@redhat.com>, Jakub Kicinski <kuba@kernel.org>,
Jisheng Zhang <jszhang@kernel.org>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
Jose Abreu <joabreu@synopsys.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Chen-Yu Tsai <wens@csie.org>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Samuel Holland <samuel@sholland.org>,
"open list:STMMAC ETHERNET DRIVER" <netdev@vger.kernel.org>,
"moderated list:ARM/STM32 ARCHITECTURE"
<linux-stm32@st-md-mailman.stormreply.com>,
"moderated list:ARM/STM32 ARCHITECTURE"
<linux-arm-kernel@lists.infradead.org>,
open list <linux-kernel@vger.kernel.org>,
"open list:ARM/Allwinner sunXi SoC support"
<linux-sunxi@lists.linux.dev>,
Marc Haber <mh+netdev@zugschlus.de>, Andrew Lunn <andrew@lunn.ch>,
Florian Fainelli <f.fainelli@gmail.com>,
stable@vger.kernel.org, alexis.lothore@bootlin.com,
Guenter Roeck <linux@roeck-us.net>
Subject: Re: [PATCH net v3] net: stmmac: protect updates of 64-bit statistics counters
Date: Wed, 6 Mar 2024 11:03:12 +0100 [thread overview]
Message-ID: <20240306110312.04ddcde3@meshulam.tesarici.cz> (raw)
In-Reply-To: <20240306100153.32d305f7@meshulam.tesarici.cz>
On Wed, 6 Mar 2024 10:01:53 +0100
Petr Tesařík <petr@tesarici.cz> wrote:
> On Wed, 6 Mar 2024 09:23:53 +0100
> "Linux regression tracking (Thorsten Leemhuis)" <regressions@leemhuis.info> wrote:
>
> > On 28.02.24 12:03, Petr Tesařík wrote:
> > > On Wed, 28 Feb 2024 07:19:56 +0100
> > > "Linux regression tracking (Thorsten Leemhuis)" <regressions@leemhuis.info> wrote:
> > >
> > >> Net maintainers, chiming in here, as it seems handling this regression
> > >> stalled.
> > > Indeed, I was too busy with sandbox mode...
> >
> > Hmm, no reply in the past week to Petr's request for help from someone
> > with more knowledge about the field. :-/
> >
> > So I guess this means that this won't be fixed for 6.8? Unfortunate, but
> > well, that's how it it sometimes.
>
> For the record, I _can_ reproduce lockdep splats on my device, but they
> don't make any sense to me. They seem to confirm Jisheng Zhang's
> conclusion that lockdep conflates two locks which should have different
> lock-classes.
>
> So far I have noticed only one issue: the per-cpu syncp's are not
> initialized. I'll recompile and see if that's what confuses lockdep.
That wasn't the issue. FTR the syncp was in fact initialized, because
devm_netdev_alloc_pcpu_stats() is a macro that also takes care of the
initialization of the syncp struct field.
The problem is u64_stats_init().
Commit 9464ca650008 ("net: make u64_stats_init() a function") changed
it to an inline function. But that's wrong. It uses seqcount_init(),
which in turn declares:
static struct lock_class_key __key;
This assumes that each lock gets its own instance. But if
u64_stats_init() is a function (albeit an inline one), all calls
within the same file end up using the same instance.
Eric, would it be OK to revert the above-mentioned commit?
Petr T
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2024-03-06 10:03 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-03 19:09 [PATCH net v3] net: stmmac: protect updates of 64-bit statistics counters Petr Tesarik
2024-02-03 19:09 ` Petr Tesarik
2024-02-04 4:21 ` Jisheng Zhang
2024-02-04 4:21 ` Jisheng Zhang
2024-02-07 9:10 ` patchwork-bot+netdevbpf
2024-02-07 9:10 ` patchwork-bot+netdevbpf
2024-02-12 4:30 ` Guenter Roeck
2024-02-12 4:30 ` Guenter Roeck
2024-02-13 14:16 ` Jisheng Zhang
2024-02-13 14:16 ` Jisheng Zhang
2024-02-13 14:51 ` Eric Dumazet
2024-02-13 14:51 ` Eric Dumazet
2024-02-13 15:26 ` Guenter Roeck
2024-02-13 15:26 ` Guenter Roeck
2024-02-13 15:52 ` Eric Dumazet
2024-02-13 15:52 ` Eric Dumazet
2024-02-27 9:40 ` Alexis Lothoré
2024-02-27 9:40 ` Alexis Lothoré
2024-02-28 6:19 ` Linux regression tracking (Thorsten Leemhuis)
2024-02-28 6:19 ` Linux regression tracking (Thorsten Leemhuis)
2024-02-28 11:03 ` Petr Tesařík
2024-02-28 11:03 ` Petr Tesařík
2024-03-06 8:23 ` Linux regression tracking (Thorsten Leemhuis)
2024-03-06 8:23 ` Linux regression tracking (Thorsten Leemhuis)
2024-03-06 9:01 ` Petr Tesařík
2024-03-06 9:01 ` Petr Tesařík
2024-03-06 10:03 ` Petr Tesařík [this message]
2024-03-06 10:03 ` Petr Tesařík
2024-03-06 10:17 ` Eric Dumazet
2024-03-06 10:17 ` Eric Dumazet
2024-02-26 17:41 ` Guenter Roeck
2024-02-26 17:41 ` Guenter Roeck
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=20240306110312.04ddcde3@meshulam.tesarici.cz \
--to=petr@tesarici.cz \
--cc=alexandre.torgue@foss.st.com \
--cc=alexis.lothore@bootlin.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=jernej.skrabec@gmail.com \
--cc=joabreu@synopsys.com \
--cc=jszhang@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=linux-sunxi@lists.linux.dev \
--cc=linux@roeck-us.net \
--cc=mcoquelin.stm32@gmail.com \
--cc=mh+netdev@zugschlus.de \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=regressions@leemhuis.info \
--cc=regressions@lists.linux.dev \
--cc=samuel@sholland.org \
--cc=stable@vger.kernel.org \
--cc=wens@csie.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.