netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/4] batch calls to fib_flush and arp_ifdown
@ 2016-01-04 23:10 Salam Noureddine
  2016-01-04 23:10 ` [PATCH net-next 1/4] net: add event_list to struct net and provide utility functions Salam Noureddine
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Salam Noureddine @ 2016-01-04 23:10 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jiri Pirko, Alexei Starovoitov,
	Daniel Borkmann, Eric W. Biederman, netdev
  Cc: Salam Noureddine

fib_flush walks the whole fib in a net_namespace and is called for
each net_device being closed or unregistered. This can be very expensive
when dealing with 100k or more routes in the fib and removal of a lot
of interfaces. These four patches deal with this issue by calling fib_flush
just once for each net namespace and introduce a new function arp_ifdown_all
that does a similar optimization for the neighbour table.

Salam Noureddine (4):
  net: add event_list to struct net and provide utility functions
  net: dev: add batching to net_device notifiers
  net: core: introduce neigh_ifdown_all for all down interfaces
  net: fib: avoid calling fib_flush for each device when doing batch
    close     and unregister

 include/linux/netdevice.h   |  2 ++
 include/net/arp.h           |  1 +
 include/net/neighbour.h     |  1 +
 include/net/net_namespace.h | 22 ++++++++++++++++++++++
 include/net/netns/ipv4.h    |  1 +
 net/core/dev.c              | 39 ++++++++++++++++++++++++++++++++++++---
 net/core/neighbour.c        | 38 +++++++++++++++++++++++++++++++-------
 net/ipv4/arp.c              |  4 ++++
 net/ipv4/fib_frontend.c     | 16 ++++++++++++++--
 9 files changed, 112 insertions(+), 12 deletions(-)

-- 
1.8.1.4

^ permalink raw reply	[flat|nested] 9+ messages in thread
* [PATCH net-next 0/4] batch calls to fib_flush and arp_ifdown
@ 2016-02-01 22:32 Salam Noureddine
  0 siblings, 0 replies; 9+ messages in thread
From: Salam Noureddine @ 2016-02-01 22:32 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jiri Pirko, Alexei Starovoitov,
	Daniel Borkmann, Eric W. Biederman, netdev
  Cc: Salam Noureddine

fib_flush walks the whole fib in a net_namespace and is called for
each net_device being closed or unregistered. This can be very expensive
when dealing with 100k or more routes in the fib and removal of a lot
of interfaces. These four patches deal with this issue by calling fib_flush
just once for each net namespace and introduce a new function arp_ifdown_all
that does a similar optimization for the neighbour table.

I got the following benchmark results on one of our switches.
Without this patch, deleting 1k interfaces with 100k routes in the fib held
the rtnl_lock for 13 seconds. With the patch, rtnl_lock hold time went down
to 5 seconds. The gain is even more pronounced with 512k routes in the FIB.
In this case, without the patch, rtnl_lock was held for 36 seconds and with
the patch it was held for 5.5 seconds.

Salam Noureddine (4):
  net: add event_list to struct net and provide utility functions
  net: dev: add batching to net_device notifiers
  net: core: introduce neigh_ifdown_all for all down interfaces
  net: fib: avoid calling fib_flush for each device when doing batch
    close     and unregister

 include/linux/netdevice.h   |  2 ++
 include/net/arp.h           |  1 +
 include/net/neighbour.h     |  1 +
 include/net/net_namespace.h | 22 ++++++++++++++++++++++
 include/net/netns/ipv4.h    |  1 +
 net/core/dev.c              | 39 ++++++++++++++++++++++++++++++++++++---
 net/core/neighbour.c        | 38 +++++++++++++++++++++++++++++++-------
 net/ipv4/arp.c              |  4 ++++
 net/ipv4/fib_frontend.c     | 16 ++++++++++++++--
 9 files changed, 112 insertions(+), 12 deletions(-)

-- 
1.8.1.4

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-02-01 22:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-04 23:10 [PATCH net-next 0/4] batch calls to fib_flush and arp_ifdown Salam Noureddine
2016-01-04 23:10 ` [PATCH net-next 1/4] net: add event_list to struct net and provide utility functions Salam Noureddine
2016-01-04 23:10 ` [PATCH net-next 2/4] net: dev: add batching to net_device notifiers Salam Noureddine
2016-01-04 23:10 ` [PATCH net-next 3/4] net: core: introduce neigh_ifdown_all for all down interfaces Salam Noureddine
2016-01-04 23:10 ` [PATCH net-next 4/4] net: fib: avoid calling fib_flush for each device when doing batch close and unregister Salam Noureddine
2016-01-05  0:35 ` [PATCH net-next 0/4] batch calls to fib_flush and arp_ifdown Eric W. Biederman
2016-01-05  1:12   ` Salam Noureddine
2016-01-12  1:53     ` Salam Noureddine
  -- strict thread matches above, loose matches on Subject: below --
2016-02-01 22:32 Salam Noureddine

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).