linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <simon.horman@corigine.com>
To: Jason Xing <kerneljasonxing@gmail.com>
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, Jason Xing <kernelxing@tencent.com>
Subject: Re: [PATCH net-next] net-sysfs: display two backlog queue len separately
Date: Mon, 13 Mar 2023 13:11:03 +0100	[thread overview]
Message-ID: <ZA8S14QtdBduQEVq@corigine.com> (raw)
In-Reply-To: <CAL+tcoDi5fVWjyTX6wjJGKrszqL6JWkEgDBajhZchYSW7kyhGQ@mail.gmail.com>

On Mon, Mar 13, 2023 at 09:55:37AM +0800, Jason Xing wrote:
> On Mon, Mar 13, 2023 at 3:02 AM Simon Horman <simon.horman@corigine.com> wrote:
> >
> > On Sat, Mar 11, 2023 at 11:17:56PM +0800, Jason Xing wrote:
> > > From: Jason Xing <kernelxing@tencent.com>
> > >
> > > Sometimes we need to know which one of backlog queue can be exactly
> > > long enough to cause some latency when debugging this part is needed.
> > > Thus, we can then separate the display of both.
> > >
> > > Signed-off-by: Jason Xing <kernelxing@tencent.com>
> > > ---
> > >  net/core/net-procfs.c | 17 ++++++++++++-----
> > >  1 file changed, 12 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/net/core/net-procfs.c b/net/core/net-procfs.c
> > > index 1ec23bf8b05c..97a304e1957a 100644
> > > --- a/net/core/net-procfs.c
> > > +++ b/net/core/net-procfs.c
> > > @@ -115,10 +115,14 @@ static int dev_seq_show(struct seq_file *seq, void *v)
> > >       return 0;
> > >  }
> > >
> > > -static u32 softnet_backlog_len(struct softnet_data *sd)
> > > +static u32 softnet_input_pkt_queue_len(struct softnet_data *sd)
> > >  {
> > > -     return skb_queue_len_lockless(&sd->input_pkt_queue) +
> > > -            skb_queue_len_lockless(&sd->process_queue);
> > > +     return skb_queue_len_lockless(&sd->input_pkt_queue);
> > > +}
> > > +
> > > +static u32 softnet_process_queue_len(struct softnet_data *sd)
> > > +{
> > > +     return skb_queue_len_lockless(&sd->process_queue);
> > >  }
> > >
> > >  static struct softnet_data *softnet_get_online(loff_t *pos)
> > > @@ -169,12 +173,15 @@ static int softnet_seq_show(struct seq_file *seq, void *v)
> > >        * mapping the data a specific CPU
> > >        */
> > >       seq_printf(seq,
> > > -                "%08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x\n",
> > > +                "%08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x "
> > > +                "%08x %08x\n",
> > >                  sd->processed, sd->dropped, sd->time_squeeze, 0,
> > >                  0, 0, 0, 0, /* was fastroute */
> > >                  0,   /* was cpu_collision */
> > >                  sd->received_rps, flow_limit_count,
> > > -                softnet_backlog_len(sd), (int)seq->index);
> > > +                0,   /* was len of two backlog queues */
> > > +                (int)seq->index,
> >
> > nit: I think you could avoid this cast by using %llx as the format specifier.
> 
> I'm not sure if I should change this format since the above line is
> introduced in commit 7d58e6555870d ('net-sysfs: add backlog len and
> CPU id to softnet data').
> The seq->index here manifests which cpu it uses, so it can be
> displayed in 'int' format. Meanwhile, using %8x to output is much
> cleaner if the user executes 'cat /proc/net/softnet_stat'.
> 
> What do you think about this?

I think %08llx might be a good way to go.
But perhaps I'm missing something wrt to changing user-facing output.

In any case, this is more a suggestion than a request for a change.

  parent reply	other threads:[~2023-03-13 12:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-11 15:17 [PATCH net-next] net-sysfs: display two backlog queue len separately Jason Xing
2023-03-12 19:02 ` Simon Horman
2023-03-13  1:55   ` Jason Xing
2023-03-13  2:28     ` Stephen Hemminger
2023-03-13  2:42       ` Jason Xing
2023-03-13  9:03       ` Jason Xing
2023-03-13 12:11     ` Simon Horman [this message]
2023-03-13 12:19       ` Jason Xing
2023-03-13 12:34 ` Eric Dumazet
2023-03-13 13:15   ` Jason Xing
2023-03-13 15:59     ` Eric Dumazet
2023-03-13 17:15       ` Jason Xing
2023-03-13 17:33         ` Eric Dumazet
2023-03-14  1:54           ` Jason Xing

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=ZA8S14QtdBduQEVq@corigine.com \
    --to=simon.horman@corigine.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kerneljasonxing@gmail.com \
    --cc=kernelxing@tencent.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --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).