lkml.org 
[lkml]   [2022]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.19 1146/1157] mptcp: refine memory scheduling
    Date
    From: Paolo Abeni <pabeni@redhat.com>

    commit 69d93daec026cdda98e29e8edb12534bfa5b1a9b upstream.

    Similar to commit 7c80b038d23e ("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>
    ---
    net/mptcp/protocol.c | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    --- a/net/mptcp/protocol.c
    +++ b/net/mptcp/protocol.c
    @@ -323,9 +323,10 @@ static bool mptcp_rmem_schedule(struct s
    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;

    \
     
     \ /
      Last update: 2022-08-16 03:08    [W:2.988 / U:0.828 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site