[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <294021ae1fae426d868195be77b053bd66f31772.camel@redhat.com>
Date: Mon, 21 Feb 2022 09:23:57 +0100
From: Paolo Abeni <pabeni@...hat.com>
To: Eric Dumazet <eric.dumazet@...il.com>,
"David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>
Cc: netdev <netdev@...r.kernel.org>, Eric Dumazet <edumazet@...gle.com>
Subject: Re: [PATCH v2 net-next] gro_cells: avoid using synchronize_rcu() in
gro_cells_destroy()
Hello,
On Sat, 2022-02-19 at 20:11 -0800, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@...gle.com>
>
> Another thing making netns dismantles potentially very slow is located
> in gro_cells_destroy(),
> whenever cleanup_net() has to remove a device using gro_cells framework.
>
> RTNL is not held at this stage, so synchronize_net()
> is calling synchronize_rcu():
>
> netdev_run_todo()
> ip_tunnel_dev_free()
> gro_cells_destroy()
> synchronize_net()
> synchronize_rcu() // Ouch.
>
> This patch uses call_rcu(), and gave me a 25x performance improvement
> in my tests.
>
> cleanup_net() is no longer blocked ~10 ms per synchronize_rcu()
> call.
>
> In the case we could not allocate the memory needed to queue the
> deferred free, use synchronize_rcu_expedited()
>
> v2: made percpu_free_defer_callback() static
>
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
I'm sorry for the late feedback. I'm wondering if you considered
placing the 'defer' pointer inside 'gro_cells' and allocating it at
gro_cells_init() init time?
Thanks!
Paolo
Powered by blists - more mailing lists