netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 00/14] Remove rtnl lock dependency from all action implementations
@ 2018-08-06  6:54 Vlad Buslov
  2018-08-06  6:54 ` [PATCH net-next 01/14] net: sched: act_bpf: remove dependency on rtnl lock Vlad Buslov
                   ` (13 more replies)
  0 siblings, 14 replies; 24+ messages in thread
From: Vlad Buslov @ 2018-08-06  6:54 UTC (permalink / raw)
  To: netdev
  Cc: davem, jhs, xiyou.wangcong, jiri, pablo, kadlec, fw, ast, daniel,
	edumazet, keescook, marcelo.leitner, Vlad Buslov

Currently, all netlink protocol handlers for updating rules, actions and
qdiscs are protected with single global rtnl lock which removes any
possibility for parallelism. This patch set is a second step to remove
rtnl lock dependency from TC rules update path.

Recently, new rtnl registration flag RTNL_FLAG_DOIT_UNLOCKED was added.
Handlers registered with this flag are called without RTNL taken. End
goal is to have rule update handlers(RTM_NEWTFILTER, RTM_DELTFILTER,
etc.) to be registered with UNLOCKED flag to allow parallel execution.
However, there is no intention to completely remove or split rtnl lock
itself. This patch set addresses specific problems in implementation of
tc actions that prevent their control path from being executed
concurrently. Additional changes are required to refactor classifiers
API and individual classifiers for parallel execution. This patch set
lays groundwork to eventually register rule update handlers as
rtnl-unlocked.

Action API is already prepared for parallel execution with previous
patch set, which means that action ops that use action API for their
implementation do not require additional modifications. (delete, search,
etc.) Action API implements concurrency-safe reference counting and
guarantees that cleanup/delete is called only once, after last reference
to action is released.

The goal of this change is to update specific actions APIs that access
action private state directly, in order to be independent from external
locking. General approach is to re-use existing tcf_lock spinlock (used
by some action implementation to synchronize control path with data
path) to protect action private state from concurrent modification. If
action has rcu-protected pointer, tcf spinlock is used to protect its
update code, instead of relying on rtnl lock.

Some actions need to determine rtnl mutex status in order to release it.
For example, ife action can load additional kernel modules(meta ops) and
must make sure that no locks are held during module load. In such cases
'rtnl_held' argument is used to conditionally release rtnl mutex.

Vlad Buslov (14):
  net: sched: act_bpf: remove dependency on rtnl lock
  net: sched: act_csum: remove dependency on rtnl lock
  net: sched: act_gact: remove dependency on rtnl lock
  net: sched: act_ife: remove dependency on rtnl lock
  net: sched: act_ipt: remove dependency on rtnl lock
  net: sched: act_pedit: remove dependency on rtnl lock
  net: sched: act_sample: remove dependency on rtnl lock
  net: sched: act_simple: remove dependency on rtnl lock
  net: sched: act_skbmod: remove dependency on rtnl lock
  net: sched: act_tunnel_key: remove dependency on rtnl lock
  net: sched: act_vlan: remove dependency on rtnl lock
  net: sched: act_mirred: remove dependency on rtnl lock
  net: core: add new/replace rate estimator lock parameter
  net: sched: act_police: remove dependency on rtnl lock

 include/net/gen_stats.h            |  2 +
 include/net/tc_act/tc_mirred.h     |  5 +++
 include/net/tc_act/tc_tunnel_key.h | 33 ++++++++++++---
 net/core/gen_estimator.c           | 58 ++++++++++++++++++++-------
 net/netfilter/xt_RATEEST.c         |  2 +-
 net/sched/act_api.c                |  2 +-
 net/sched/act_bpf.c                | 10 +++--
 net/sched/act_csum.c               | 24 ++++++-----
 net/sched/act_gact.c               | 10 ++++-
 net/sched/act_ife.c                | 40 ++++++++++++-------
 net/sched/act_ipt.c                |  3 ++
 net/sched/act_mirred.c             | 82 +++++++++++++++++++++++++-------------
 net/sched/act_pedit.c              | 40 +++++++++----------
 net/sched/act_police.c             | 10 +++--
 net/sched/act_sample.c             | 12 +++++-
 net/sched/act_simple.c             |  6 ++-
 net/sched/act_skbmod.c             | 14 ++++---
 net/sched/act_tunnel_key.c         | 26 ++++++------
 net/sched/act_vlan.c               | 27 +++++++------
 net/sched/cls_api.c                |  1 +
 net/sched/sch_api.c                |  2 +
 net/sched/sch_cbq.c                |  4 +-
 net/sched/sch_drr.c                |  4 +-
 net/sched/sch_hfsc.c               |  4 +-
 net/sched/sch_htb.c                |  4 +-
 net/sched/sch_qfq.c                |  4 +-
 26 files changed, 285 insertions(+), 144 deletions(-)

-- 
2.7.5

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

end of thread, other threads:[~2018-08-08 16:38 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-06  6:54 [PATCH net-next 00/14] Remove rtnl lock dependency from all action implementations Vlad Buslov
2018-08-06  6:54 ` [PATCH net-next 01/14] net: sched: act_bpf: remove dependency on rtnl lock Vlad Buslov
2018-08-06  6:54 ` [PATCH net-next 02/14] net: sched: act_csum: " Vlad Buslov
2018-08-06  6:54 ` [PATCH net-next 03/14] net: sched: act_gact: " Vlad Buslov
2018-08-06  6:54 ` [PATCH net-next 04/14] net: sched: act_ife: " Vlad Buslov
2018-08-06  6:54 ` [PATCH net-next 05/14] net: sched: act_ipt: " Vlad Buslov
2018-08-06  6:54 ` [PATCH net-next 06/14] net: sched: act_pedit: " Vlad Buslov
2018-08-06  6:54 ` [PATCH net-next 07/14] net: sched: act_sample: " Vlad Buslov
2018-08-06  6:54 ` [PATCH net-next 08/14] net: sched: act_simple: " Vlad Buslov
2018-08-06  6:54 ` [PATCH net-next 09/14] net: sched: act_skbmod: " Vlad Buslov
2018-08-06  6:54 ` [PATCH net-next 10/14] net: sched: act_tunnel_key: " Vlad Buslov
2018-08-06  6:54 ` [PATCH net-next 11/14] net: sched: act_vlan: " Vlad Buslov
2018-08-06  6:54 ` [PATCH net-next 12/14] net: sched: act_mirred: " Vlad Buslov
2018-08-07 16:36   ` Jiri Pirko
2018-08-08  7:40     ` Vlad Buslov
2018-08-08  8:03       ` Jiri Pirko
2018-08-08  8:47         ` Vlad Buslov
2018-08-08  8:54           ` Jiri Pirko
2018-08-08 11:21             ` Vlad Buslov
2018-08-06  6:54 ` [PATCH net-next 13/14] net: core: add new/replace rate estimator lock parameter Vlad Buslov
2018-08-08  1:37   ` Marcelo Ricardo Leitner
2018-08-08 12:30     ` Vlad Buslov
2018-08-08 14:18       ` Marcelo Ricardo Leitner
2018-08-06  6:54 ` [PATCH net-next 14/14] net: sched: act_police: remove dependency on rtnl lock Vlad Buslov

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