diff mbox series

[net-next] ipv6: use call_rcu_hurry() in fib6_info_release()

Message ID 20240426104722.1612331-1-edumazet@google.com (mailing list archive)
State Accepted
Commit b5327b9a300e2ecec1372ed375615f39e3df0542
Delegated to: Netdev Maintainers
Headers show
Series [net-next] ipv6: use call_rcu_hurry() in fib6_info_release() | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1422 this patch: 1422
netdev/build_tools success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang success Errors and warnings before: 938 this patch: 938
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1444 this patch: 1444
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-04-26--21-00 (tests: 992)

Commit Message

Eric Dumazet April 26, 2024, 10:47 a.m. UTC
This is a followup of commit c4e86b4363ac ("net: add two more
call_rcu_hurry()")

fib6_info_destroy_rcu() is calling nexthop_put() or fib6_nh_release()

We must not delay it too much or risk unregister_netdevice/ref_tracker
traces because references to netdev are not released in time.

This should speedup device/netns dismantles when CONFIG_RCU_LAZY=y

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 include/net/ip6_fib.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jiri Pirko April 26, 2024, 11:21 a.m. UTC | #1
Fri, Apr 26, 2024 at 12:47:22PM CEST, edumazet@google.com wrote:
>This is a followup of commit c4e86b4363ac ("net: add two more
>call_rcu_hurry()")
>
>fib6_info_destroy_rcu() is calling nexthop_put() or fib6_nh_release()
>
>We must not delay it too much or risk unregister_netdevice/ref_tracker
>traces because references to netdev are not released in time.
>
>This should speedup device/netns dismantles when CONFIG_RCU_LAZY=y
>
>Signed-off-by: Eric Dumazet <edumazet@google.com>

Reviewed-by: Jiri Pirko <jiri@nvidia.com>
David Ahern April 26, 2024, 2:31 p.m. UTC | #2
On 4/26/24 4:47 AM, Eric Dumazet wrote:
> This is a followup of commit c4e86b4363ac ("net: add two more
> call_rcu_hurry()")
> 
> fib6_info_destroy_rcu() is calling nexthop_put() or fib6_nh_release()
> 
> We must not delay it too much or risk unregister_netdevice/ref_tracker
> traces because references to netdev are not released in time.
> 
> This should speedup device/netns dismantles when CONFIG_RCU_LAZY=y
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
>  include/net/ip6_fib.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 


Reviewed-by: David Ahern <dsahern@kernel.org>
patchwork-bot+netdevbpf@kernel.org April 29, 2024, 9:10 a.m. UTC | #3
Hello:

This patch was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Fri, 26 Apr 2024 10:47:22 +0000 you wrote:
> This is a followup of commit c4e86b4363ac ("net: add two more
> call_rcu_hurry()")
> 
> fib6_info_destroy_rcu() is calling nexthop_put() or fib6_nh_release()
> 
> We must not delay it too much or risk unregister_netdevice/ref_tracker
> traces because references to netdev are not released in time.
> 
> [...]

Here is the summary with links:
  - [net-next] ipv6: use call_rcu_hurry() in fib6_info_release()
    https://git.kernel.org/netdev/net-next/c/b5327b9a300e

You are awesome, thank you!
diff mbox series

Patch

diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index 323c94f1845b9e3eed52a2a19a4871cf8174d9c2..7834f7f29d3c9323e753be9e46499784a619de1b 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -338,7 +338,7 @@  static inline void fib6_info_release(struct fib6_info *f6i)
 {
 	if (f6i && refcount_dec_and_test(&f6i->fib6_ref)) {
 		DEBUG_NET_WARN_ON_ONCE(!hlist_unhashed(&f6i->gc_link));
-		call_rcu(&f6i->rcu, fib6_info_destroy_rcu);
+		call_rcu_hurry(&f6i->rcu, fib6_info_destroy_rcu);
 	}
 }