From: Mat Martineau <mathew.j.martineau@linux.intel.com>
To: Paolo Abeni <pabeni@redhat.com>
Cc: mptcp@lists.linux.dev
Subject: Re: [PATCH v4 mptcp-next 1/4] mptcp: never fetch fwd memory from the subflow
Date: Tue, 21 Jun 2022 15:35:13 -0700 (PDT) [thread overview]
Message-ID: <f6421a9f-b294-862-2077-67a2e57eeb43@linux.intel.com> (raw)
In-Reply-To: <630f7e13d7226f8c37a9cc0c66008a298c1e6b9e.1655828070.git.pabeni@redhat.com>
On Tue, 21 Jun 2022, Paolo Abeni wrote:
> The memory accounting is broken in such exceptional code
> path, and after commit 4890b686f408 ("net: keep sk->sk_forward_alloc
> as small as possible") we can't find much help there.
>
> Drop the broken code.
>
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> ---
Thanks Paolo, v4 looks good.
For patches 1-3:
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
See patch 4 for different tag.
> This is possibly for net, but makes sense only on top of recent
> net-next patches, so whatever ;)
I agree it makes sense for net-next.
- Mat
> ---
> net/mptcp/protocol.c | 11 +++--------
> 1 file changed, 3 insertions(+), 8 deletions(-)
>
> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> index 6d2aa41390e7..0d4b2c010da0 100644
> --- a/net/mptcp/protocol.c
> +++ b/net/mptcp/protocol.c
> @@ -328,15 +328,10 @@ static bool mptcp_rmem_schedule(struct sock *sk, struct sock *ssk, int size)
>
> amt = sk_mem_pages(size);
> amount = amt << PAGE_SHIFT;
> - msk->rmem_fwd_alloc += amount;
> - if (!__sk_mem_raise_allocated(sk, size, amt, SK_MEM_RECV)) {
> - if (ssk->sk_forward_alloc < amount) {
> - msk->rmem_fwd_alloc -= amount;
> - return false;
> - }
> + if (!__sk_mem_raise_allocated(sk, size, amt, SK_MEM_RECV))
> + return false;
>
> - ssk->sk_forward_alloc -= amount;
> - }
> + msk->rmem_fwd_alloc += amount;
> return true;
> }
>
> --
> 2.35.3
>
>
>
--
Mat Martineau
Intel
next prev parent reply other threads:[~2022-06-21 22:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-21 16:27 [PATCH v4 mptcp-next 1/4] mptcp: never fetch fwd memory from the subflow Paolo Abeni
2022-06-21 16:27 ` [PATCH v4 mptcp-next 2/4] mptcp: drop SK_RECLAIM_* macros Paolo Abeni
2022-06-21 16:27 ` [PATCH v4 mptcp-next 3/4] mptcp: refine memory scheduling Paolo Abeni
2022-06-21 16:27 ` [PATCH v4 mptcp-next 4/4] net: remove SK_RECLAIM_THRESHOLD and SK_RECLAIM_CHUNK Paolo Abeni
2022-06-21 22:38 ` Mat Martineau
2022-06-22 21:09 ` Matthieu Baerts
2022-06-21 22:35 ` Mat Martineau [this message]
2022-06-21 22:46 ` [PATCH v4 mptcp-next 1/4] mptcp: never fetch fwd memory from the subflow Mat Martineau
2022-06-22 8:31 ` 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=f6421a9f-b294-862-2077-67a2e57eeb43@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;
as well as URLs for NNTP newsgroup(s).