Skip to contentSkip to conversation

enable and use static_branch_deferred_inc

PATCH In review Willem de Bruijn 3 participants 5 messages Jun 13, 2019 – Jun 15, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover enable and use static_branch_deferred_inc

From: Willem de Bruijn <[email protected]>

1. make static_branch_deferred_inc available if !CONFIG_JUMP_LABEL
2. convert the existing STATIC_KEY_DEFERRED_FALSE user to this api

Willem de Bruijn (2):
locking/static_key: always define static_branch_deferred_inc
tcp: use static_branch_deferred_inc for clean_acked_data_enabled

 include/linux/jump_label_ratelimit.h | 5 +++--
 net/ipv4/tcp_input.c                 | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)
Signature · 1 line
2.22.0.rc2.383.gf4fbbf30c2-goog
#1 lore raw

PATCH 1/2 locking/static_key: always define static_branch_deferred_inc

From: Willem de Bruijn <[email protected]>

This interface is currently only defined if CONFIG_JUMP_LABEL. Make it available also when jump labels are off.

---
 include/linux/jump_label_ratelimit.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
include/linux/jump_label_ratelimit.h +3 -2
index 42710d5949ba..8c3ee291b2d8 100644
@@ -60,8 +60,6 @@ extern void jump_label_update_timeout(struct work_struct *work);
 						   0),			\
 	}
 
-#define static_branch_deferred_inc(x)	static_branch_inc(&(x)->key)
-
 #else	/* !CONFIG_JUMP_LABEL */
 struct static_key_deferred {
 	struct static_key  key;
@@ -95,4 +93,7 @@ jump_label_rate_limit(struct static_key_deferred *key,
 	STATIC_KEY_CHECK_USE(key);
 }
 #endif	/* CONFIG_JUMP_LABEL */
+
+#define static_branch_deferred_inc(x)	static_branch_inc(&(x)->key)
+
 #endif	/* _LINUX_JUMP_LABEL_RATELIMIT_H */
Signature · 1 line
2.22.0.rc2.383.gf4fbbf30c2-goog
#2 lore raw

PATCH 2/2 tcp: use static_branch_deferred_inc for clean_acked_data_enabled

In reply to Willem de Bruijn

From: Willem de Bruijn <[email protected]>

Deferred static key clean_acked_data_enabled uses the deferred variants of dec and flush. Do the same for inc.

---
 net/ipv4/tcp_input.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/tcp_input.c +1 -1
index 08a477e74cf3..9269bbfc05f9 100644
@@ -119,7 +119,7 @@ void clean_acked_data_enable(struct inet_connection_sock *icsk,
 			     void (*cad)(struct sock *sk, u32 ack_seq))
 {
 	icsk->icsk_clean_acked = cad;
-	static_branch_inc(&clean_acked_data_enabled.key);
+	static_branch_deferred_inc(&clean_acked_data_enabled);
 }
 EXPORT_SYMBOL_GPL(clean_acked_data_enable);
 
Signature · 1 line
2.22.0.rc2.383.gf4fbbf30c2-goog