All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 00/13] Refactor classifier API to work with Qdisc/blocks without rtnl lock
@ 2018-09-06  7:58 Vlad Buslov
  2018-09-06  7:58 ` [PATCH net-next 01/13] net: core: netlink: add helper refcount dec and lock function Vlad Buslov
                   ` (12 more replies)
  0 siblings, 13 replies; 28+ messages in thread
From: Vlad Buslov @ 2018-09-06  7:58 UTC (permalink / raw)
  To: netdev
  Cc: jhs, xiyou.wangcong, jiri, davem, stephen, ktkhai, paulmck,
	nicolas.dichtel, leon, gregkh, mark.rutland, fw, dsahern,
	lucien.xin, jakub.kicinski, christian.brauner, jbenc,
	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 third 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
classifiers API that prevent its 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 by modifying code in cls API that works with Qdiscs and
blocks. Following patch set does the same for chains and classifiers.

The goal of this change is to refactor tcf_block_find() and its
dependencies to allow concurrent execution:
- Extend Qdisc API with rcu to lookup and take reference to Qdisc
  without relying on rtnl lock.
- Extend tcf_block with atomic reference counting and rcu.
- Always take reference to tcf_block while working with it.
- Implement tcf_block_release() to release resources obtained by
  tcf_block_find()
- Create infrastructure to allow registering Qdiscs with class ops that
  do not require the caller to hold rtnl lock.

All three netlink rule update handlers use tcf_block_find() to lookup
Qdisc and block, and this patch set introduces additional means of
synchronization to substitute rtnl lock in cls API.

Some functions in cls and sch APIs have historic names that no longer
clearly describe their intent. In order not make this code even more
confusing when introducing their concurrency-friendly versions, rename
these functions to describe actual implementation.

Vlad Buslov (13):
  net: core: netlink: add helper refcount dec and lock function
  net: sched: rename qdisc_destroy() to qdisc_put()
  net: sched: extend Qdisc with rcu
  net: sched: add helper function to take reference to Qdisc
  net: sched: use Qdisc rcu API instead of relying on rtnl lock
  net: sched: change tcf block reference counter type to refcount_t
  net: sched: implement functions to put and flush all chains
  net: sched: rename tcf_block_get{_ext}() and tcf_block_put{_ext}()
  net: sched: extend tcf_block with rcu
  net: sched: protect block idr with spinlock
  net: sched: implement tcf_block_get() and tcf_block_put()
  net: sched: use reference counting for tcf blocks on rules update
  net: sched: add flags to Qdisc class ops struct

 include/linux/rtnetlink.h |   6 +
 include/net/pkt_cls.h     |  36 +++---
 include/net/pkt_sched.h   |   1 +
 include/net/sch_generic.h |  28 ++++-
 net/core/rtnetlink.c      |   6 +
 net/sched/cls_api.c       | 281 ++++++++++++++++++++++++++++++++--------------
 net/sched/sch_api.c       |  24 +++-
 net/sched/sch_atm.c       |  14 +--
 net/sched/sch_cake.c      |   4 +-
 net/sched/sch_cbq.c       |  15 +--
 net/sched/sch_cbs.c       |   2 +-
 net/sched/sch_drr.c       |   8 +-
 net/sched/sch_dsmark.c    |   6 +-
 net/sched/sch_fifo.c      |   2 +-
 net/sched/sch_fq_codel.c  |   4 +-
 net/sched/sch_generic.c   |  48 ++++++--
 net/sched/sch_hfsc.c      |  13 ++-
 net/sched/sch_htb.c       |  17 +--
 net/sched/sch_ingress.c   |  15 +--
 net/sched/sch_mq.c        |   4 +-
 net/sched/sch_mqprio.c    |   4 +-
 net/sched/sch_multiq.c    |  10 +-
 net/sched/sch_netem.c     |   2 +-
 net/sched/sch_prio.c      |  10 +-
 net/sched/sch_qfq.c       |   8 +-
 net/sched/sch_red.c       |   4 +-
 net/sched/sch_sfb.c       |   8 +-
 net/sched/sch_sfq.c       |   4 +-
 net/sched/sch_tbf.c       |   4 +-
 29 files changed, 394 insertions(+), 194 deletions(-)

-- 
2.7.5

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

end of thread, other threads:[~2018-09-14 20:43 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-06  7:58 [PATCH net-next 00/13] Refactor classifier API to work with Qdisc/blocks without rtnl lock Vlad Buslov
2018-09-06  7:58 ` [PATCH net-next 01/13] net: core: netlink: add helper refcount dec and lock function Vlad Buslov
2018-09-06  7:58 ` [PATCH net-next 02/13] net: sched: rename qdisc_destroy() to qdisc_put() Vlad Buslov
2018-09-06  7:58 ` [PATCH net-next 03/13] net: sched: extend Qdisc with rcu Vlad Buslov
2018-09-06  8:30   ` Eric Dumazet
2018-09-06  8:39     ` Kirill Tkhai
2018-09-06  9:21       ` Eric Dumazet
2018-09-06  9:23       ` Vlad Buslov
2018-09-06  9:29         ` Eric Dumazet
2018-09-06  7:58 ` [PATCH net-next 04/13] net: sched: add helper function to take reference to Qdisc Vlad Buslov
2018-09-06  7:58 ` [PATCH net-next 05/13] net: sched: use Qdisc rcu API instead of relying on rtnl lock Vlad Buslov
2018-09-06  7:58 ` [PATCH net-next 06/13] net: sched: change tcf block reference counter type to refcount_t Vlad Buslov
2018-09-06  7:58 ` [PATCH net-next 07/13] net: sched: implement functions to put and flush all chains Vlad Buslov
2018-09-06  7:58 ` [PATCH net-next 08/13] net: sched: rename tcf_block_get{_ext}() and tcf_block_put{_ext}() Vlad Buslov
2018-09-07 20:09   ` Cong Wang
2018-09-12  8:24     ` Vlad Buslov
2018-09-13 17:21       ` Cong Wang
2018-09-14 10:38         ` Vlad Buslov
2018-09-14 15:24           ` Jiri Pirko
2018-09-06  7:58 ` [PATCH net-next 09/13] net: sched: extend tcf_block with rcu Vlad Buslov
2018-09-07 19:52   ` Cong Wang
2018-09-12  8:25     ` Vlad Buslov
2018-09-06  7:58 ` [PATCH net-next 10/13] net: sched: protect block idr with spinlock Vlad Buslov
2018-09-06  7:59 ` [PATCH net-next 11/13] net: sched: implement tcf_block_get() and tcf_block_put() Vlad Buslov
2018-09-06  7:59 ` [PATCH net-next 12/13] net: sched: use reference counting for tcf blocks on rules update Vlad Buslov
2018-09-06  7:59 ` [PATCH net-next 13/13] net: sched: add flags to Qdisc class ops struct Vlad Buslov
2018-09-07 19:50   ` Cong Wang
2018-09-12  8:25     ` Vlad Buslov

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.