From: Mat Martineau <mathew.j.martineau@linux.intel.com>
To: Paolo Abeni <pabeni@redhat.com>
Cc: mptcp@lists.linux.dev
Subject: Re: [PATCH net-next v3 3/3] mptcp: refine memory scheduling
Date: Mon, 20 Jun 2022 13:32:11 -0700 (PDT) [thread overview]
Message-ID: <246f2b96-7e12-ba51-d77f-b38e662eb89@linux.intel.com> (raw)
In-Reply-To: <9ab1ce9ee1019cb90181d4e6268c37448c8af46b.1655741931.git.pabeni@redhat.com>
On Mon, 20 Jun 2022, Paolo Abeni wrote:
> 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>
> ---
> net/mptcp/protocol.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> index b31bac33f87a..0e295b3bce54 100644
> --- a/net/mptcp/protocol.c
> +++ b/net/mptcp/protocol.c
> @@ -326,6 +326,7 @@ static bool mptcp_rmem_schedule(struct sock *sk, struct sock *ssk, int size)
> if (size < msk->rmem_fwd_alloc)
With the change below, also would be good to change the above line to:
if (size <= msk->rmem_fwd_alloc)
so there's no attempt to allocate 0 new pages.
> return true;
>
> + size -= msk->rmem_fwd_alloc;
> amt = sk_mem_pages(size);
> amount = amt << PAGE_SHIFT;
> if (!__sk_mem_raise_allocated(sk, size, amt, SK_MEM_RECV))
> --
> 2.35.3
>
>
>
--
Mat Martineau
Intel
next prev parent reply other threads:[~2022-06-20 20:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-20 16:19 [PATCH net-next v3 1/3] mptcp: never fetch fwd memory from the subflow Paolo Abeni
2022-06-20 16:19 ` [PATCH net-next v3 2/3] mptcp: drop SK_RECLAIM_* macros Paolo Abeni
2022-06-20 20:38 ` Mat Martineau
2022-06-20 16:19 ` [PATCH net-next v3 3/3] mptcp: refine memory scheduling Paolo Abeni
2022-06-20 20:32 ` Mat Martineau [this message]
2022-06-20 16:46 ` [PATCH net-next v3 1/3] mptcp: never fetch fwd memory from the subflow Paolo Abeni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=246f2b96-7e12-ba51-d77f-b38e662eb89@linux.intel.com \
--to=mathew.j.martineau@linux.intel.com \
--cc=mptcp@lists.linux.dev \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox