[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y8ml6VQ2L+YQqGmB@pop-os.localdomain>
Date: Thu, 19 Jan 2023 12:19:53 -0800
From: Cong Wang <xiyou.wangcong@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Paolo Abeni <pabeni@...hat.com>, davem@...emloft.net,
netdev@...r.kernel.org, edumazet@...gle.com,
Linux Kernel Functional Testing <lkft@...aro.org>,
jhs@...atatu.com, jiri@...nulli.us, john.hurley@...ronome.com
Subject: Re: [PATCH net] net: sched: gred: prevent races when adding offloads
to stats
On Tue, Jan 17, 2023 at 11:10:19AM -0800, Jakub Kicinski wrote:
> On Tue, 17 Jan 2023 10:00:56 +0100 Paolo Abeni wrote:
> > On Sat, 2023-01-14 at 18:20 -0800, Cong Wang wrote:
> > > On Thu, Jan 12, 2023 at 08:41:37PM -0800, Jakub Kicinski wrote:
> > > > Naresh reports seeing a warning that gred is calling
> > > > u64_stats_update_begin() with preemption enabled.
> > > > Arnd points out it's coming from _bstats_update().
> > >
> > > The stack trace looks confusing to me without further decoding.
> > >
> > > Are you sure we use sch->qstats/bstats in __dev_queue_xmit() there
> > > not any netdev stats? It may be a false positive one as they may end up
> > > with the same lockdep class.
>
> I didn't repro this myself, TBH, but there is u64_stats_update_begin()
> inside _bstats_update(). Pretty sure it will trigger the warning that
> preemption is not disabled on non-SMP systems.
>
> > I'm unsure I read you comment correctly. Please note that the
> > referenced message includes several splats. The first one - arguably
> > the most relevant - points to the lack of locking in the gred control
> > path.
>
> Yup, I'm not really sure if we're fixing the right splat for the bug.
> But I am fairly confident we should be holding a lock while writing
> bstats from the dump path, enqueue/dequeue may run concurrently.
Explain htb_dump_class_stats()? :) I see two _bstats_update() calls but
I don't see any tree lock there.
Thanks.
Powered by blists - more mailing lists