]> git.baikalelectronics.ru Git - kernel.git/commit
mptcp: implement wmem reservation
authorPaolo Abeni <pabeni@redhat.com>
Fri, 27 Nov 2020 10:10:23 +0000 (11:10 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 1 Dec 2020 01:55:23 +0000 (17:55 -0800)
commit887cb70c950484ac0e6fbf68591f38596c0dca5c
treee6620b22e75c17f5510dda10982e2a234ebe88bc
parent173bcdd3f4bdd0d7cc6eb4a8599c0542e9c547e3
mptcp: implement wmem reservation

This leverages the previous commit to reserve the wmem
required for the sendmsg() operation when the msk socket
lock is first acquired.
Some heuristics are used to get a reasonable [over] estimation of
the whole memory required. If we can't forward alloc such amount
fallback to a reasonable small chunk, otherwise enter the wait
for memory path.

When sendmsg() needs more memory it looks at wmem_reserved
first and if that is exhausted, move more space from
sk_forward_alloc.

The reserved memory is not persistent and is released at the
next socket unlock via the release_cb().

Overall this will simplify the next patch.

Acked-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/mptcp/protocol.c
net/mptcp/protocol.h