From: Mat Martineau <mathew.j.martineau@linux.intel.com>
To: Paolo Abeni <pabeni@redhat.com>
Cc: mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next 1/3] mptcp: optimize release_cb for the common case
Date: Mon, 21 Mar 2022 17:22:21 -0700 (PDT) [thread overview]
Message-ID: <5090893b-932c-6086-93ee-dfc357dbe859@linux.intel.com> (raw)
In-Reply-To: <6fc1ea29ae85074d626ad1cef3fea34055de37f1.1647601548.git.pabeni@redhat.com>
On Fri, 18 Mar 2022, Paolo Abeni wrote:
> The mptcp release callback checks several flags in atomic
> context, but only MPTCP_CLEAN_UNA can be up frequently.
>
> Reorganize the code to avoid multiple conditionals in the
> most common scenarios.
>
> Additional clarify a related comment.
>
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> ---
> net/mptcp/protocol.c | 16 +++++++++-------
> 1 file changed, 9 insertions(+), 7 deletions(-)
>
This one LGTM:
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> index fbb14dfe62b3..bdba1ddee2a7 100644
> --- a/net/mptcp/protocol.c
> +++ b/net/mptcp/protocol.c
> @@ -3118,15 +3118,17 @@ static void mptcp_release_cb(struct sock *sk)
> spin_lock_bh(&sk->sk_lock.slock);
> }
>
> - /* be sure to set the current sk state before tacking actions
> - * depending on sk_state
> - */
> - if (__test_and_clear_bit(MPTCP_CONNECTED, &msk->cb_flags))
> - __mptcp_set_connected(sk);
> if (__test_and_clear_bit(MPTCP_CLEAN_UNA, &msk->cb_flags))
> __mptcp_clean_una_wakeup(sk);
> - if (__test_and_clear_bit(MPTCP_ERROR_REPORT, &msk->cb_flags))
> - __mptcp_error_report(sk);
> + if (unlikely(&msk->cb_flags)) {
> + /* be sure to set the current sk state before tacking actions
> + * depending on sk_state, that is processing MPTCP_ERROR_REPORT
> + */
> + if (__test_and_clear_bit(MPTCP_CONNECTED, &msk->cb_flags))
> + __mptcp_set_connected(sk);
> + if (__test_and_clear_bit(MPTCP_ERROR_REPORT, &msk->cb_flags))
> + __mptcp_error_report(sk);
> + }
>
> __mptcp_update_rmem(sk);
> }
> --
> 2.35.1
>
>
>
--
Mat Martineau
Intel
prev parent reply other threads:[~2022-03-22 0:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-18 11:06 [PATCH mptcp-next 1/3] mptcp: optimize release_cb for the common case Paolo Abeni
2022-03-18 11:06 ` [PATCH mptcp-next 2/3] mptcp: reset the packet scheduler on incoming MP_PRIO Paolo Abeni
2022-03-22 0:21 ` Mat Martineau
2022-03-22 14:46 ` Paolo Abeni
2022-03-18 11:06 ` [PATCH mptcp-next 3/3] mptcp: reset the packet scheduler on PRIO change Paolo Abeni
2022-03-22 0:22 ` Mat Martineau
2022-03-22 0:22 ` Mat Martineau [this message]
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=5090893b-932c-6086-93ee-dfc357dbe859@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.