All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 00/19] net: add preliminary netdev refcount tracking
@ 2021-12-02  3:21 Eric Dumazet
  2021-12-02  3:21 ` [PATCH net-next 01/19] lib: add reference counting tracking infrastructure Eric Dumazet
                   ` (19 more replies)
  0 siblings, 20 replies; 42+ messages in thread
From: Eric Dumazet @ 2021-12-02  3:21 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski
  Cc: netdev, Dmitry Vyukov, Eric Dumazet, Eric Dumazet

From: Eric Dumazet <edumazet@google.com>

Two first patches add a generic infrastructure, that will be used
to get tracking of refcount increments/decrements.

The general idea is to be able to precisely pair each decrement with
a corresponding prior increment. Both share a cookie, basically
a pointer to private data storing stack traces.

Then a series of 17 patches converts some dev_hold()/dev_put()
pairs to new hepers : dev_hold_track() and dev_put_track().

Hopefully this will be used by developpers and syzbot to
root cause bugs that cause netdevice dismantles freezes.

With CONFIG_PCPU_DEV_REFCNT=n option, we were able to detect
some class of bugs, but too late (when too many dev_put()
were happening).

Eric Dumazet (19):
  lib: add reference counting tracking infrastructure
  lib: add tests for reference tracker
  net: add dev_hold_track() and dev_put_track() helpers
  net: add net device refcount tracker to struct netdev_rx_queue
  net: add net device refcount tracker to struct netdev_queue
  net: add net device refcount tracker to ethtool_phys_id()
  net: add net device refcount tracker to dev_ifsioc()
  drop_monitor: add net device refcount tracker
  net: dst: add net device refcount tracking to dst_entry
  ipv6: add net device refcount tracker to rt6_probe_deferred()
  sit: add net device refcount tracking to ip_tunnel
  ipv6: add net device refcount tracker to struct ip6_tnl
  net: add net device refcount tracker to struct neighbour
  net: add net device refcount tracker to struct pneigh_entry
  net: add net device refcount tracker to struct neigh_parms
  net: add net device refcount tracker to struct netdev_adjacent
  ipv6: add net device refcount tracker to struct inet6_dev
  ipv4: add net device refcount tracker to struct in_device
  net/sched: add net device refcount tracker to struct Qdisc

 include/linux/inetdevice.h  |   2 +
 include/linux/netdevice.h   |  53 ++++++++++++++
 include/linux/ref_tracker.h |  73 +++++++++++++++++++
 include/net/devlink.h       |   3 +
 include/net/dst.h           |   1 +
 include/net/if_inet6.h      |   1 +
 include/net/ip6_tunnel.h    |   1 +
 include/net/ip_tunnels.h    |   3 +
 include/net/neighbour.h     |   3 +
 include/net/sch_generic.h   |   2 +-
 lib/Kconfig                 |   4 ++
 lib/Kconfig.debug           |  10 +++
 lib/Makefile                |   4 +-
 lib/ref_tracker.c           | 140 ++++++++++++++++++++++++++++++++++++
 lib/test_ref_tracker.c      | 116 ++++++++++++++++++++++++++++++
 net/Kconfig                 |   8 +++
 net/core/dev.c              |  10 ++-
 net/core/dev_ioctl.c        |   5 +-
 net/core/drop_monitor.c     |   4 +-
 net/core/dst.c              |   8 +--
 net/core/neighbour.c        |  18 ++---
 net/core/net-sysfs.c        |   8 +--
 net/ethtool/ioctl.c         |   5 +-
 net/ipv4/devinet.c          |   4 +-
 net/ipv4/route.c            |   7 +-
 net/ipv6/addrconf.c         |   4 +-
 net/ipv6/addrconf_core.c    |   2 +-
 net/ipv6/ip6_gre.c          |   8 +--
 net/ipv6/ip6_tunnel.c       |   4 +-
 net/ipv6/ip6_vti.c          |   4 +-
 net/ipv6/route.c            |  10 +--
 net/ipv6/sit.c              |   4 +-
 net/sched/sch_generic.c     |   4 +-
 33 files changed, 481 insertions(+), 52 deletions(-)
 create mode 100644 include/linux/ref_tracker.h
 create mode 100644 lib/ref_tracker.c
 create mode 100644 lib/test_ref_tracker.c

-- 
2.34.0.rc2.393.gf8c9666880-goog


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

end of thread, other threads:[~2022-05-23 18:44 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-02  3:21 [PATCH net-next 00/19] net: add preliminary netdev refcount tracking Eric Dumazet
2021-12-02  3:21 ` [PATCH net-next 01/19] lib: add reference counting tracking infrastructure Eric Dumazet
2021-12-02  8:12   ` Dmitry Vyukov
2021-12-02 16:05     ` Eric Dumazet
2021-12-02  3:21 ` [PATCH net-next 02/19] lib: add tests for reference tracker Eric Dumazet
2021-12-02  3:31   ` Eric Dumazet
2021-12-02  9:03   ` kernel test robot
2021-12-02  9:03     ` kernel test robot
2021-12-02 19:25   ` kernel test robot
2021-12-02 19:25     ` kernel test robot
2021-12-02 19:46     ` Eric Dumazet
2021-12-02 19:46       ` Eric Dumazet
2021-12-03  7:37       ` Dmitry Vyukov
2021-12-03  7:37         ` Dmitry Vyukov
2021-12-02  3:21 ` [PATCH net-next 03/19] net: add dev_hold_track() and dev_put_track() helpers Eric Dumazet
2022-05-23 18:03   ` Jakub Kicinski
2022-05-23 18:14     ` Eric Dumazet
2022-05-23 18:26       ` Jakub Kicinski
2021-12-02  3:21 ` [PATCH net-next 04/19] net: add net device refcount tracker to struct netdev_rx_queue Eric Dumazet
2021-12-02  3:21 ` [PATCH net-next 05/19] net: add net device refcount tracker to struct netdev_queue Eric Dumazet
2021-12-02  3:21 ` [PATCH net-next 06/19] net: add net device refcount tracker to ethtool_phys_id() Eric Dumazet
2021-12-02  3:21 ` [PATCH net-next 07/19] net: add net device refcount tracker to dev_ifsioc() Eric Dumazet
2021-12-02  3:21 ` [PATCH net-next 08/19] drop_monitor: add net device refcount tracker Eric Dumazet
2021-12-02  5:40   ` kernel test robot
2021-12-02  5:40     ` kernel test robot
2021-12-02  5:57     ` Eric Dumazet
2021-12-02  5:57       ` Eric Dumazet
2021-12-02  3:21 ` [PATCH net-next 09/19] net: dst: add net device refcount tracking to dst_entry Eric Dumazet
2021-12-02  3:21 ` [PATCH net-next 10/19] ipv6: add net device refcount tracker to rt6_probe_deferred() Eric Dumazet
2021-12-02  3:21 ` [PATCH net-next 11/19] sit: add net device refcount tracking to ip_tunnel Eric Dumazet
2021-12-02  3:21 ` [PATCH net-next 12/19] ipv6: add net device refcount tracker to struct ip6_tnl Eric Dumazet
2021-12-02  3:21 ` [PATCH net-next 13/19] net: add net device refcount tracker to struct neighbour Eric Dumazet
2021-12-02  3:21 ` [PATCH net-next 14/19] net: add net device refcount tracker to struct pneigh_entry Eric Dumazet
2021-12-02  3:21 ` [PATCH net-next 15/19] net: add net device refcount tracker to struct neigh_parms Eric Dumazet
2021-12-02  3:21 ` [PATCH net-next 16/19] net: add net device refcount tracker to struct netdev_adjacent Eric Dumazet
2021-12-02  3:21 ` [PATCH net-next 17/19] ipv6: add net device refcount tracker to struct inet6_dev Eric Dumazet
2021-12-02  3:21 ` [PATCH net-next 18/19] ipv4: add net device refcount tracker to struct in_device Eric Dumazet
2021-12-02  3:21 ` [PATCH net-next 19/19] net/sched: add net device refcount tracker to struct Qdisc Eric Dumazet
2021-12-02 12:49 ` [PATCH net-next 00/19] net: add preliminary netdev refcount tracking dust.li
2021-12-02 15:13   ` Eric Dumazet
2021-12-03  3:46     ` dust.li
2021-12-03  4:06       ` Eric Dumazet

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.