netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: Kevin Kou <qdkevin.kou@gmail.com>
Cc: linux-sctp@vger.kernel.org, netdev@vger.kernel.org,
	nhorman@tuxdriver.com, davem@davemloft.net
Subject: Re: [PATCH net-next] sctp: add enabled check for path tracepoint loop.
Date: Fri, 27 Dec 2019 10:33:07 -0300	[thread overview]
Message-ID: <20191227133307.GP4444@localhost.localdomain> (raw)
In-Reply-To: <20191227131116.375-1-qdkevin.kou@gmail.com>

On Fri, Dec 27, 2019 at 01:11:16PM +0000, Kevin Kou wrote:
> sctp_outq_sack is the main function handles SACK, it is called very
> frequently. As the commit "move trace_sctp_probe_path into sctp_outq_sack"
> added below code to this function, sctp tracepoint is disabled most of time,
> but the loop of transport list will be always called even though the
> tracepoint is disabled, this is unnecessary.
> 
> +	/* SCTP path tracepoint for congestion control debugging. */
> +	list_for_each_entry(transport, transport_list, transports) {
> +		trace_sctp_probe_path(transport, asoc);
> +	}
> 
> This patch is to add tracepoint enabled check at outside of the loop of
> transport list, and avoid traversing the loop when trace is disabled,
> it is a small optimization.
> 
> Signed-off-by: Kevin Kou <qdkevin.kou@gmail.com>

Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>

Thanks Kevin.

Btw, I'm out for PTOs for the next 2 weeks. Probably won't be
reviewing patches during that.

> ---
>  net/sctp/outqueue.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
> index adceb22..83ddcfe 100644
> --- a/net/sctp/outqueue.c
> +++ b/net/sctp/outqueue.c
> @@ -1240,8 +1240,9 @@ int sctp_outq_sack(struct sctp_outq *q, struct sctp_chunk *chunk)
>  	transport_list = &asoc->peer.transport_addr_list;
>  
>  	/* SCTP path tracepoint for congestion control debugging. */
> -	list_for_each_entry(transport, transport_list, transports) {
> -		trace_sctp_probe_path(transport, asoc);
> +	if (trace_sctp_probe_path_enabled()) {
> +		list_for_each_entry(transport, transport_list, transports)
> +			trace_sctp_probe_path(transport, asoc);
>  	}
>  
>  	sack_ctsn = ntohl(sack->cum_tsn_ack);
> -- 
> 1.8.3.1
> 

      reply	other threads:[~2019-12-27 13:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-27 13:11 [PATCH net-next] sctp: add enabled check for path tracepoint loop Kevin Kou
2019-12-27 13:33 ` Marcelo Ricardo Leitner [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=20191227133307.GP4444@localhost.localdomain \
    --to=marcelo.leitner@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-sctp@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=qdkevin.kou@gmail.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).