mptcp: refine memory scheduling
commit69d93daec0
upstream. Similar to commit7c80b038d2
("net: fix sk_wmem_schedule() and sk_rmem_schedule() errors"), let the MPTCP receive path schedule exactly the required amount of memory. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
af504739ab
commit
022b2d2c4f
|
@ -323,9 +323,10 @@ static bool mptcp_rmem_schedule(struct sock *sk, struct sock *ssk, int size)
|
|||
struct mptcp_sock *msk = mptcp_sk(sk);
|
||||
int amt, amount;
|
||||
|
||||
if (size < msk->rmem_fwd_alloc)
|
||||
if (size <= msk->rmem_fwd_alloc)
|
||||
return true;
|
||||
|
||||
size -= msk->rmem_fwd_alloc;
|
||||
amt = sk_mem_pages(size);
|
||||
amount = amt << SK_MEM_QUANTUM_SHIFT;
|
||||
msk->rmem_fwd_alloc += amount;
|
||||
|
|
Loading…
Reference in New Issue