public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v3 0/5] Rework ip_ra_chain protection
@ 2018-03-22  9:44 Kirill Tkhai
  2018-03-22  9:45 ` [PATCH net-next v3 1/5] net: Revert "ipv4: get rid of ip_ra_lock" Kirill Tkhai
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Kirill Tkhai @ 2018-03-22  9:44 UTC (permalink / raw)
  To: davem, yoshfuji, edumazet, yanhaishuang, nikolay, yotamg, soheil,
	avagin, nicolas.dichtel, ebiederm, fw, roman.kapl, netdev,
	xiyou.wangcong, dvyukov, andreyknvl, lkp, ktkhai

Commit 1215e51edad1 "ipv4: fix a deadlock in ip_ra_control"
made rtnl_lock() be used in raw_close(). This function is called
on every RAW socket destruction, so that rtnl_mutex is taken
every time. This scales very sadly. I observe cleanup_net()
spending a lot of time in rtnl_lock() and raw_close() is one
of the biggest rtnl user (since we have percpu net->ipv4.icmp_sk).

This patchset reworks the locking: reverts the problem commit
and its descendant, and introduces rtnl-independent locking.
This may have a continuation, and someone may work on killing
rtnl_lock() in mrtsock_destruct() in the future.

Thanks,
Kirill

---
v3: Change patches order: [2/5] and [3/5].
v2: Fix sparse warning [4/5], as reported by kbuild test robot.

---

Kirill Tkhai (5):
      net: Revert "ipv4: get rid of ip_ra_lock"
      net: Move IP_ROUTER_ALERT out of lock_sock(sk)
      net: Revert "ipv4: fix a deadlock in ip_ra_control"
      net: Make ip_ra_chain per struct net
      net: Replace ip_ra_lock with per-net mutex


 include/net/ip.h         |   13 +++++++++++--
 include/net/netns/ipv4.h |    2 ++
 net/core/net_namespace.c |    1 +
 net/ipv4/ip_input.c      |    5 ++---
 net/ipv4/ip_sockglue.c   |   34 +++++++++++++---------------------
 net/ipv4/ipmr.c          |   11 +++++++++--
 net/ipv4/raw.c           |    2 --
 7 files changed, 38 insertions(+), 30 deletions(-)

--
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>

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

end of thread, other threads:[~2018-03-22 19:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-22  9:44 [PATCH net-next v3 0/5] Rework ip_ra_chain protection Kirill Tkhai
2018-03-22  9:45 ` [PATCH net-next v3 1/5] net: Revert "ipv4: get rid of ip_ra_lock" Kirill Tkhai
2018-03-22  9:45 ` [PATCH net-next v3 2/5] net: Move IP_ROUTER_ALERT out of lock_sock(sk) Kirill Tkhai
2018-03-22  9:45 ` [PATCH net-next v3 3/5] net: Revert "ipv4: fix a deadlock in ip_ra_control" Kirill Tkhai
2018-03-22  9:45 ` [PATCH net-next v3 4/5] net: Make ip_ra_chain per struct net Kirill Tkhai
2018-03-22  9:45 ` [PATCH net-next v3 5/5] net: Replace ip_ra_lock with per-net mutex Kirill Tkhai
2018-03-22  9:49 ` [PATCH net-next v3 0/5] Rework ip_ra_chain protection Kirill Tkhai
2018-03-22 19:14 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox