mptcp.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 mptcp-next 1/4] mptcp: never fetch fwd memory from the subflow
@ 2022-06-21 16:27 Paolo Abeni
  2022-06-21 16:27 ` [PATCH v4 mptcp-next 2/4] mptcp: drop SK_RECLAIM_* macros Paolo Abeni
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Paolo Abeni @ 2022-06-21 16:27 UTC (permalink / raw)
  To: mptcp

The memory accounting is broken in such exceptional code
path, and after commit 4890b686f408 ("net: keep sk->sk_forward_alloc
as small as possible") we can't find much help there.

Drop the broken code.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
This is possibly for net, but makes sense only on top of recent
net-next patches, so whatever ;)
---
 net/mptcp/protocol.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 6d2aa41390e7..0d4b2c010da0 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -328,15 +328,10 @@ static bool mptcp_rmem_schedule(struct sock *sk, struct sock *ssk, int size)
 
 	amt = sk_mem_pages(size);
 	amount = amt << PAGE_SHIFT;
-	msk->rmem_fwd_alloc += amount;
-	if (!__sk_mem_raise_allocated(sk, size, amt, SK_MEM_RECV)) {
-		if (ssk->sk_forward_alloc < amount) {
-			msk->rmem_fwd_alloc -= amount;
-			return false;
-		}
+	if (!__sk_mem_raise_allocated(sk, size, amt, SK_MEM_RECV))
+		return false;
 
-		ssk->sk_forward_alloc -= amount;
-	}
+	msk->rmem_fwd_alloc += amount;
 	return true;
 }
 
-- 
2.35.3


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-06-22 21:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-21 16:27 [PATCH v4 mptcp-next 1/4] mptcp: never fetch fwd memory from the subflow Paolo Abeni
2022-06-21 16:27 ` [PATCH v4 mptcp-next 2/4] mptcp: drop SK_RECLAIM_* macros Paolo Abeni
2022-06-21 16:27 ` [PATCH v4 mptcp-next 3/4] mptcp: refine memory scheduling Paolo Abeni
2022-06-21 16:27 ` [PATCH v4 mptcp-next 4/4] net: remove SK_RECLAIM_THRESHOLD and SK_RECLAIM_CHUNK Paolo Abeni
2022-06-21 22:38   ` Mat Martineau
2022-06-22 21:09     ` Matthieu Baerts
2022-06-21 22:35 ` [PATCH v4 mptcp-next 1/4] mptcp: never fetch fwd memory from the subflow Mat Martineau
2022-06-21 22:46   ` Mat Martineau
2022-06-22  8:31     ` Paolo Abeni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).