diff mbox series

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

Message ID 20240429183643.2029108-1-edumazet@google.com (mailing list archive)
State Accepted
Commit fff6e6accdb71e5dd36e50478bd82d5409ac32d2
Delegated to: Netdev Maintainers
Headers show
Series [net-next] ipv6: anycast: use call_rcu_hurry() in aca_put() | 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: 926 this patch: 926
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang success Errors and warnings before: 937 this patch: 937
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: 937 this patch: 937
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 11 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-05-01--06-00 (tests: 997)

Commit Message

Eric Dumazet April 29, 2024, 6:36 p.m. UTC
This is a followup of commit b5327b9a300e ("ipv6: use
call_rcu_hurry() in fib6_info_release()").

I had another pmtu.sh failure, and found another lazy
call_rcu() causing this failure.

aca_free_rcu() calls fib6_info_release() which releases
devices references.

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>
---
 net/ipv6/anycast.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

David Ahern April 29, 2024, 6:51 p.m. UTC | #1
On 4/29/24 12:36 PM, Eric Dumazet wrote:
> This is a followup of commit b5327b9a300e ("ipv6: use
> call_rcu_hurry() in fib6_info_release()").
> 
> I had another pmtu.sh failure, and found another lazy
> call_rcu() causing this failure.
> 
> aca_free_rcu() calls fib6_info_release() which releases
> devices references.
> 
> 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>
> ---
>  net/ipv6/anycast.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 

Reviewed-by: David Ahern <dsahern@kernel.org>
patchwork-bot+netdevbpf@kernel.org May 1, 2024, 10:50 a.m. UTC | #2
Hello:

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

On Mon, 29 Apr 2024 18:36:43 +0000 you wrote:
> This is a followup of commit b5327b9a300e ("ipv6: use
> call_rcu_hurry() in fib6_info_release()").
> 
> I had another pmtu.sh failure, and found another lazy
> call_rcu() causing this failure.
> 
> aca_free_rcu() calls fib6_info_release() which releases
> devices references.
> 
> [...]

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

You are awesome, thank you!
diff mbox series

Patch

diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c
index 0f2506e3535925468dcc5fa6cc30ae0952a67ea7..0627c4c18d1a5067a668da778ad444855194cbeb 100644
--- a/net/ipv6/anycast.c
+++ b/net/ipv6/anycast.c
@@ -252,9 +252,8 @@  static void aca_free_rcu(struct rcu_head *h)
 
 static void aca_put(struct ifacaddr6 *ac)
 {
-	if (refcount_dec_and_test(&ac->aca_refcnt)) {
-		call_rcu(&ac->rcu, aca_free_rcu);
-	}
+	if (refcount_dec_and_test(&ac->aca_refcnt))
+		call_rcu_hurry(&ac->rcu, aca_free_rcu);
 }
 
 static struct ifacaddr6 *aca_alloc(struct fib6_info *f6i,