|
77 | 77 | #include <asm/unaligned.h>
|
78 | 78 | #include <linux/errqueue.h>
|
79 | 79 | #include <trace/events/tcp.h>
|
80 |
| -#include <linux/static_key.h> |
| 80 | +#include <linux/jump_label_ratelimit.h> |
81 | 81 | #include <net/busy_poll.h>
|
82 | 82 |
|
83 | 83 | int sysctl_tcp_max_orphans __read_mostly = NR_FILE;
|
@@ -113,22 +113,28 @@ int sysctl_tcp_max_orphans __read_mostly = NR_FILE;
|
113 | 113 | #define REXMIT_NEW 2 /* FRTO-style transmit of unsent/new packets */
|
114 | 114 |
|
115 | 115 | #if IS_ENABLED(CONFIG_TLS_DEVICE)
|
116 |
| -static DEFINE_STATIC_KEY_FALSE(clean_acked_data_enabled); |
| 116 | +static DEFINE_STATIC_KEY_DEFERRED_FALSE(clean_acked_data_enabled, HZ); |
117 | 117 |
|
118 | 118 | void clean_acked_data_enable(struct inet_connection_sock *icsk,
|
119 | 119 | void (*cad)(struct sock *sk, u32 ack_seq))
|
120 | 120 | {
|
121 | 121 | icsk->icsk_clean_acked = cad;
|
122 |
| - static_branch_inc(&clean_acked_data_enabled); |
| 122 | + static_branch_inc(&clean_acked_data_enabled.key); |
123 | 123 | }
|
124 | 124 | EXPORT_SYMBOL_GPL(clean_acked_data_enable);
|
125 | 125 |
|
126 | 126 | void clean_acked_data_disable(struct inet_connection_sock *icsk)
|
127 | 127 | {
|
128 |
| - static_branch_dec(&clean_acked_data_enabled); |
| 128 | + static_branch_slow_dec_deferred(&clean_acked_data_enabled); |
129 | 129 | icsk->icsk_clean_acked = NULL;
|
130 | 130 | }
|
131 | 131 | EXPORT_SYMBOL_GPL(clean_acked_data_disable);
|
| 132 | + |
| 133 | +void clean_acked_data_flush(void) |
| 134 | +{ |
| 135 | + static_key_deferred_flush(&clean_acked_data_enabled); |
| 136 | +} |
| 137 | +EXPORT_SYMBOL_GPL(clean_acked_data_flush); |
132 | 138 | #endif
|
133 | 139 |
|
134 | 140 | static void tcp_gro_dev_warn(struct sock *sk, const struct sk_buff *skb,
|
@@ -3598,7 +3604,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)
|
3598 | 3604 | icsk->icsk_retransmits = 0;
|
3599 | 3605 |
|
3600 | 3606 | #if IS_ENABLED(CONFIG_TLS_DEVICE)
|
3601 |
| - if (static_branch_unlikely(&clean_acked_data_enabled)) |
| 3607 | + if (static_branch_unlikely(&clean_acked_data_enabled.key)) |
3602 | 3608 | if (icsk->icsk_clean_acked)
|
3603 | 3609 | icsk->icsk_clean_acked(sk, ack);
|
3604 | 3610 | #endif
|
|
0 commit comments