Skip to contentSkip to conversation

protocol: add comment to smb_mb__after_atomic

PATCH In review Florian Westphal 2 participants 2 messages Jan 14, 2020 – Jan 15, 2020

Subsystems (2)
lore
Share & tools
lore

Florian Westphal

author
#0 lore raw

PATCH 1/1 protocol: add comment to smb_mb__after_atomic

squashto: mptcp: add subflow write space signalling and mptcp_poll

msk->flags and sock->flags depend one one another, we first need to disable SEND_SPACE flag (no more wmem available for sending), then enable the write_space callbacks in the tcp core.

Signed-off-by Florian Westphal <fw(a)strlen.de>
---
 net/mptcp/protocol.c | 1 +
 1 file changed, 1 insertion(+)
net/mptcp/protocol.c +1 -0
index 6df4eb20916c..5dfca0aa7ce4 100644
@@ -547,6 +547,7 @@ static void ssk_check_wmem(struct mptcp_sock *msk, struct sock *ssk)
 	if (sock) {
 		clear_bit(MPTCP_SEND_SPACE, &msk->flags);
 		smp_mb__after_atomic();
+		/* set NOSPACE only after clearing SEND_SPACE flag */
 		set_bit(SOCK_NOSPACE, &sock->flags);
 	}
 }
Signature · 1 line
2.24.1
#1 lore raw
Quoted 5 lines · Florian Westphal

squashto: mptcp: add subflow write space signalling and mptcp_poll

msk->flags and sock->flags depend one one another, we first need to disable SEND_SPACE flag (no more wmem available for sending), then enable the write_space callbacks in the tcp core.

This dependency between msk->flags and sock->flags would also explain the barrier in subflow_write_space(), correct? That barrier is also added in this 'squashto' commit, and could benefit from a similar comment since the access to sock->flags is hidden inside sk_stream_write_space().

Mat

Quoted 24 lines
Signed-off-by Florian Westphal <fw(a)strlen.de>

---
net/mptcp/protocol.c | 1 +

1 file changed, 1 insertion(+)
net/mptcp/protocol.c +1 -0
index 6df4eb20916c..5dfca0aa7ce4 100644
@@ -547,6 +547,7 @@ static void ssk_check_wmem(struct mptcp_sock *msk, struct sock *ssk)
 	if (sock) {
 		clear_bit(MPTCP_SEND_SPACE, &msk->flags);
 		smp_mb__after_atomic();
+		/* set NOSPACE only after clearing SEND_SPACE flag */
 		set_bit(SOCK_NOSPACE, &sock->flags);
 	}
 }
Signature · 4 lines
2.24.1
_______________________________________________
mptcp mailing list -- mptcp(a)lists.01.org
To unsubscribe send an email to mptcp-leave(a)lists.01.org

--
Mat Martineau
Intel