[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3410304ae2006ce9d8816429c2423591f8a9317e.camel@redhat.com>
Date: Mon, 20 May 2024 17:30:16 +0200
From: Paolo Abeni <pabeni@...hat.com>
To: Eric Dumazet <edumazet@...gle.com>
Cc: netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>, Jakub
Kicinski <kuba@...nel.org>, David Ahern <dsahern@...nel.org>, Sabrina
Dubroca <sd@...asysnail.net>
Subject: Re: [RFC PATCH] net: flush dst_cache on device removal
On Mon, 2024-05-20 at 15:54 +0200, Eric Dumazet wrote:
> On Mon, May 20, 2024 at 1:00 PM Paolo Abeni <pabeni@...hat.com> wrote:
> >
> > Eric reported that dst_cache don't cope correctly with device removal,
> > keeping the cached dst unmodified even when the underlining device is
> > deleted and the dst itself is not uncached.
> >
> > The above causes the infamous 'unregistering netdevice' hangup.
> >
> > Address the issue implementing explicit book-keeping of all the
> > initialized dst_caches. At network device unregistration time, traverse
> > them, looking for relevant dst and eventually replace the dst reference
> > with a blackhole one.
> >
> > Use an xarray to store the dst_cache references, to avoid blocking the
> > BH during the traversal for a possibly unbounded time.
> >
> > Reported-by: Eric Dumazet <edumazet@...gle.com>
> > Fixes: 911362c70df5 ("net: add dst_cache support")
> > Signed-off-by: Paolo Abeni <pabeni@...hat.com>
> > ---
> > I can't reproduce the issue locally, I hope somebody able to observe it
> > could step-in and give this patch a shot.
> > ---
>
> H Paolo, thanks for your patch.
>
> It seems dst_cache_netdev_event() could spend an awful amount of cpu
> in complex setups.
I agree.
> I wonder if we could instead reuse the existing uncached_list
> mechanism we have already ?
Then rt_flush_dev()/fib_netdev_event() will use a similar amount of
time, right? Or do you mean something entirely different?
On the plus side it will make this patch much smaller, dropping the
notifier.
> BTW it seems we could get rid of the ul->quarantine lists.
I think 'quarantine' is used to avoid traversing multiple times the
same/already blackholed entries when processing multiple
NETDEV_UNREGISTER events before the dst entries themself are freed.
Could it make a difference at netns disposal time with many dst and
devices in there?
Cheers,
Paolo
Powered by blists - more mailing lists