netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: netdev@vger.kernel.org, jhs@mojatatu.com,
	john.fastabend@gmail.com, kda@google.com, xiaotian@google.com
Subject: Re: [RFC net-next] net: sched: do not acquire qdisc spinlock in qdisc/class stats dump
Date: Fri, 20 May 2016 19:38:58 -0400 (EDT)	[thread overview]
Message-ID: <20160520.193858.303047987973510057.davem@davemloft.net> (raw)
In-Reply-To: <1463661320.18194.178.camel@edumazet-glaptop3.roam.corp.google.com>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 19 May 2016 05:35:20 -0700

> From: Eric Dumazet <edumazet@google.com>
> 
> Large tc dumps (tc -s {qdisc|class} sh dev ethX) done by Google BwE host
> agent [1] are problematic at scale :
>     
> For each qdisc/class found in the dump, we currently lock the root qdisc
> spinlock in order to get stats. Sampling stats every 5 seconds from
> thousands of HTB classes is a challenge when the root qdisc spinlock is
> under high pressure.
> 
> These stats are using u64 or u32 fields, so reading integral values
> should not prevent writers from doing concurrent updates if the kernel
> arch is a 64bit one.
> 
> Being able to atomically fetch all counters like packets and bytes sent
> at the expense of interfering in fast path (queue and dequeue packets)
> is simply not worth the pain, as the values are generally stale after 1
> usec.
> 
> These lock acquisitions slow down the fast path by 10 to 20 %
> 
> An audit of existing qdiscs showed that sch_fq_codel is the only qdisc
> that might need the qdisc lock in fq_codel_dump_stats() and
> fq_codel_dump_class_stats()
> 
> gnet_dump_force_lock() call is added there and could be added to other
> qdisc stat handlers if needed.
> 
> [1]
> http://static.googleusercontent.com/media/research.google.com/en//pubs/archive/43838.pdf
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>

I guess the off-by-one situations are not a big enough deal to code new
locking or memory barrier for, so I'm fine with this.

Please resubmit when I open net-next back up, thanks.

  parent reply	other threads:[~2016-05-20 23:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-19 12:35 [RFC net-next] net: sched: do not acquire qdisc spinlock in qdisc/class stats dump Eric Dumazet
2016-05-19 16:08 ` Alexei Starovoitov
2016-05-19 17:02   ` Eric Dumazet
2016-05-20  1:50 ` Cong Wang
2016-05-20  2:45   ` Eric Dumazet
2016-05-20  5:23     ` Cong Wang
2016-05-20  5:50       ` Eric Dumazet
2016-05-22 16:35         ` Jamal Hadi Salim
2016-05-20 12:44     ` Eric Dumazet
2016-05-20 13:01       ` Eric Dumazet
2016-05-20 13:09         ` Eric Dumazet
2016-05-20 23:38 ` David Miller [this message]
2016-05-22 16:30 ` Jamal Hadi Salim

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=20160520.193858.303047987973510057.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=jhs@mojatatu.com \
    --cc=john.fastabend@gmail.com \
    --cc=kda@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=xiaotian@google.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).