mptcp: try harder to borrow memory from subflow under pressure
authorPaolo Abeni <pabeni@redhat.com>
Thu, 10 Jun 2021 22:59:40 +0000 (15:59 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Jun 2021 23:47:44 +0000 (16:47 -0700)
commit72f961320d5d15bfcb26dbe3edaa3f7d25fd2c8a
treeecb8946df4c325764123ee723ef56b83ceed3dc6
parent22488e45501eca74653b502b194eb0eb25d2ad00
mptcp: try harder to borrow memory from subflow under pressure

If the host is under sever memory pressure, and RX forward
memory allocation for the msk fails, we try to borrow the
required memory from the ingress subflow.

The current attempt is a bit flaky: if skb->truesize is less
than SK_MEM_QUANTUM, the ssk will not release any memory, and
the next schedule will fail again.

Instead, directly move the required amount of pages from the
ssk to the msk, if available

Fixes: 9c3f94e1681b ("mptcp: add missing memory scheduling in the rx path")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mptcp/protocol.c