netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Pedro Tammela <pctammela@mojatatu.com>, netdev@vger.kernel.org
Cc: jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org
Subject: Re: [PATCH net-next 3/3] net/sched: act_gate: use percpu stats
Date: Tue, 14 Feb 2023 10:22:20 +0100	[thread overview]
Message-ID: <8b99e6732da7820457d3c0dde841d25fefb8c30a.camel@redhat.com> (raw)
In-Reply-To: <20230210202725.446422-4-pctammela@mojatatu.com>

On Fri, 2023-02-10 at 17:27 -0300, Pedro Tammela wrote:
> 
> diff --git a/net/sched/act_gate.c b/net/sched/act_gate.c
> index 9b8def0be..684b7a79f 100644
> --- a/net/sched/act_gate.c
> +++ b/net/sched/act_gate.c
> @@ -120,10 +120,10 @@ TC_INDIRECT_SCOPE int tcf_gate_act(struct sk_buff *skb,
>  {
>  	struct tcf_gate *gact = to_gate(a);
>  
> -	spin_lock(&gact->tcf_lock);
> -
>  	tcf_lastuse_update(&gact->tcf_tm);
> -	bstats_update(&gact->tcf_bstats, skb);
> +	tcf_action_update_bstats(&gact->common, skb);
> +
> +	spin_lock(&gact->tcf_lock);

I think that RCU-ifying the 'current_gate_status' field, setting its
value with  WRITE_ONCE (both in _init and in gate_timer_func()) and
finally accessing it here with READ_ONCE, you could move pretty much
everything except the code touching *_octets update outside the
spinlock.

I'm not sure how much that will be relevant - e.g. how frequently we
expect to hit the 

	if (gact->current_max_octets >= 0) {

code path.

For sure the current code allocates per_cpu stats, but they are never
used.

Cheers,

Paolo


      reply	other threads:[~2023-02-14  9:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-10 20:27 [PATCH net-next 0/3] net/sched: transition actions to pcpu stats and rcu Pedro Tammela
2023-02-10 20:27 ` [PATCH net-next 1/3] net/sched: act_nat: transition to percpu " Pedro Tammela
2023-02-14  9:05   ` Paolo Abeni
2023-02-10 20:27 ` [PATCH net-next 2/3] net/sched: act_connmark: " Pedro Tammela
2023-02-14  9:03   ` Paolo Abeni
2023-02-14 14:31     ` Pedro Tammela
2023-02-10 20:27 ` [PATCH net-next 3/3] net/sched: act_gate: use percpu stats Pedro Tammela
2023-02-14  9:22   ` Paolo Abeni [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=8b99e6732da7820457d3c0dde841d25fefb8c30a.camel@redhat.com \
    --to=pabeni@redhat.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pctammela@mojatatu.com \
    --cc=xiyou.wangcong@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).