linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: Vlad Buslov <vladbu@mellanox.com>
Cc: Linux Kernel Network Developers <netdev@vger.kernel.org>,
	David Miller <davem@davemloft.net>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	Jiri Pirko <jiri@resnulli.us>,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>,
	Florian Westphal <fw@strlen.de>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Eric Dumazet <edumazet@google.com>,
	Kees Cook <keescook@chromium.org>,
	LKML <linux-kernel@vger.kernel.org>,
	NetFilter <netfilter-devel@vger.kernel.org>,
	coreteam@netfilter.org, kliteyn@mellanox.com
Subject: Re: [PATCH 00/14] Modify action API for implementing lockless actions
Date: Fri, 25 May 2018 14:40:24 -0700	[thread overview]
Message-ID: <CAM_iQpUKxY1jc9mfNYfd+0wy_Oe7xttHXazg3SU=8Doq+0uoZg@mail.gmail.com> (raw)
In-Reply-To: <vbfo9h3zd01.fsf@reg-r-vrt-018-180.mtr.labs.mlnx>

On Fri, May 25, 2018 at 1:39 PM, Vlad Buslov <vladbu@mellanox.com> wrote:
>
> On Thu 24 May 2018 at 23:34, Cong Wang <xiyou.wangcong@gmail.com> wrote:
>> On Mon, May 14, 2018 at 7:27 AM, Vlad Buslov <vladbu@mellanox.com> wrote:
>>> 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 first step to remove
>>> rtnl lock dependency from TC rules update path. It updates act API to
>>> use atomic operations, rcu and spinlocks for fine-grained locking. It
>>> also extend API with functions that are needed to update existing
>>> actions for parallel execution.
>>
>> Can you give a summary here for what and how it is achieved?
>
> Got it, will expand cover letter in V2 with summary.
>>
>> You said this is the first step, what do you want to achieve in this
>> very first step? And how do you achieve it? Do you break the RTNL
>
> But aren't this questions answered in paragraph you quoted?


Obviously not, you said to remove it, but never explains why it can
be removed and how it is removed. This is crucial for review.

"use atomic operations, rcu and spinlocks for fine-grained locking"
is literately nothing, why atomic/rcu makes RTNL unnecessary?
How RCU is used? What spinlocks are you talking about? What
do these spinlocks protect after removing RTNL? Why are they
safe with other netdevice and netns operations?

You explain _nothing_ here. Really. Please don't force people to
read 14 patches to understand how it works. In fact, no one wants
to read the code unless there is some high-level explanation that
makes basic sense.


> What: Change act API to not rely on one-big-global-RTNL-lock and to use
> more fine-grained synchronization methods to allow safe concurrent
> execution.

Sure, how fine-grained it is after your patchset? Why this fine-grained
lock could safely replace RTNL?

Could you stop letting us guess your puzzle words? It would save your
time from exchanging emails with me, it would save my time from
guessing you too. It is a win-win.


> How: Refactor act API code to use atomics, rcu and spinlocks, etc. for
> protecting shared data structures, add new functions required to update


What shared data structures? The per-netns idr which is already protected
by a spinlock? The TC hierarchy? The shared standalone actions? Hey,
why do I have to guess? :-/


> specific actions implementation for parallel execution. (step 2)


Claim is easy, prove is hard. I can easily claim I break RTNL down
to a per-netns lock, but I can't prove it really works. :-D


>
> If you feel that this cover letter is too terse, I will add outline of
> changes in V2.

It is not my rule, it is how you have to help people to review your
14 patches. I think it is a fair game: you help people like me to
review your patches, we help you to get them reviewed and merged
if they all make sense.



>
>> lock down to, for a quick example, a per-device lock? Or perhaps you
>> completely remove it because of what reason?
>
> I want to remove RTNL _dependency_ from act API data structures and
> code. I probably should me more specific in this case:
>
> Florian recently made a change that allows registering netlink protocol
> handlers with flag RTNL_FLAG_DOIT_UNLOCKED. Handlers registered with
> this flag are called without RTNL taken. My end goal is to have rule
> update handlers(RTM_NEWTFILTER, RTM_DELTFILTER, etc.) to be registered
> with UNLOCKED flag to allow parallel execution.


Please add this paragraph in your cover letter, it is very important for review.

>
> I do not intend to globally remove or break RTNL.
>
>>
>> I go through all the descriptions of your 14 patches (but not any code),
>> I still have no clue how you successfully avoid RTNL. Please don't
>> let me read into your code to understand that, there must be some
>> high-level justification on how it works. Without it, I don't event want
>> to read into the code.
>
> On internal code review I've been asked not to duplicate info from
> commit messages in cover letter, but I guess I can expand it with some
> high level outline in V2.

In cover letter, you should put a high-level overview of "why" and "how".
If, in the worst case, on high-level it doesn't make sense, why should
we bother to read the code? In short, you have to convince people to
read your code here.

In each patch description, you should explain what a single patch does.
I don't see any duplication.

      reply	other threads:[~2018-05-25 21:40 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-14 14:27 [PATCH 00/14] Modify action API for implementing lockless actions Vlad Buslov
2018-05-14 14:27 ` [PATCH 01/14] net: sched: use rcu for action cookie update Vlad Buslov
2018-05-14 15:10   ` Jiri Pirko
2018-05-14 23:39   ` kbuild test robot
2018-05-14 14:27 ` [PATCH 02/14] net: sched: change type of reference and bind counters Vlad Buslov
2018-05-14 15:11   ` Jiri Pirko
2018-05-19 21:04   ` Marcelo Ricardo Leitner
2018-05-20 10:55     ` Vlad Buslov
2018-05-14 14:27 ` [PATCH 03/14] net: sched: add 'delete' function to action ops Vlad Buslov
2018-05-14 15:12   ` Jiri Pirko
2018-05-14 16:30     ` Jiri Pirko
2018-05-14 14:27 ` [PATCH 04/14] net: sched: implement unlocked action init API Vlad Buslov
2018-05-14 15:16   ` Jiri Pirko
2018-05-19 21:11     ` Marcelo Ricardo Leitner
2018-05-14 14:27 ` [PATCH 05/14] net: sched: always take reference to action Vlad Buslov
2018-05-14 16:23   ` Jiri Pirko
2018-05-14 18:49     ` Vlad Buslov
2018-05-15  8:58       ` Jiri Pirko
2018-05-15 11:52         ` Vlad Buslov
2018-05-15  1:38   ` kbuild test robot
2018-05-15  1:38   ` [RFC PATCH] net: sched: __tcf_idr_check() can be static kbuild test robot
2018-05-14 14:27 ` [PATCH 06/14] net: sched: implement reference counted action release Vlad Buslov
2018-05-14 16:28   ` Jiri Pirko
2018-05-14 16:47   ` Jiri Pirko
2018-05-14 19:07     ` Vlad Buslov
2018-05-15  9:03       ` Jiri Pirko
2018-05-15  9:16         ` Vlad Buslov
2018-05-19 21:43   ` Marcelo Ricardo Leitner
2018-05-20  6:22     ` Jiri Pirko
2018-05-20 10:59       ` Vlad Buslov
2018-05-14 14:27 ` [PATCH 07/14] net: sched: use reference counting action init Vlad Buslov
2018-05-15 11:24   ` Jiri Pirko
2018-05-15 11:32     ` Vlad Buslov
2018-05-15 11:39       ` Jiri Pirko
2018-05-15 11:41         ` Vlad Buslov
2018-05-15 11:57           ` Jiri Pirko
2018-05-15 12:00             ` Vlad Buslov
2018-05-14 14:27 ` [PATCH 08/14] net: sched: account for temporary action reference Vlad Buslov
2018-05-16  7:12   ` Jiri Pirko
2018-05-14 14:27 ` [PATCH 09/14] net: sched: don't release reference on action overwrite Vlad Buslov
2018-05-16  7:43   ` Jiri Pirko
2018-05-16  7:47     ` Vlad Buslov
2018-05-16  7:50       ` Jiri Pirko
2018-05-19 21:52   ` Marcelo Ricardo Leitner
2018-05-20 18:42     ` Vlad Buslov
2018-05-14 14:27 ` [PATCH 10/14] net: sched: extend act API for lockless actions Vlad Buslov
2018-05-16  7:50   ` Jiri Pirko
2018-05-16  8:16     ` Vlad Buslov
2018-05-16  8:56       ` Jiri Pirko
2018-05-16  9:39         ` Vlad Buslov
2018-05-19 22:17   ` Marcelo Ricardo Leitner
2018-05-14 14:27 ` [PATCH 11/14] net: core: add new/replace rate estimator lock parameter Vlad Buslov
2018-05-16  9:54   ` Jiri Pirko
2018-05-16 10:00     ` Vlad Buslov
2018-05-16 10:11       ` Jiri Pirko
2018-05-14 14:27 ` [PATCH 12/14] net: sched: retry action check-insert on concurrent modification Vlad Buslov
2018-05-16  9:59   ` Jiri Pirko
2018-05-16 11:55     ` Vlad Buslov
2018-05-16 12:26       ` Jiri Pirko
2018-05-16 12:43         ` Vlad Buslov
2018-05-16 13:21           ` Jiri Pirko
2018-05-16 13:52             ` Vlad Buslov
2018-05-16 14:13               ` Jiri Pirko
2018-05-16 14:26                 ` Vlad Buslov
2018-05-16 14:55                   ` Jiri Pirko
2018-05-19 22:35             ` Marcelo Ricardo Leitner
2018-05-14 14:27 ` [PATCH 13/14] net: sched: use unique idr insert function in unlocked actions Vlad Buslov
2018-05-16  9:50   ` Jiri Pirko
2018-05-16  9:54     ` Vlad Buslov
2018-05-19 22:20   ` Marcelo Ricardo Leitner
2018-05-20 21:13     ` Or Gerlitz
2018-05-20 21:33       ` Marcelo Ricardo Leitner
2018-05-20 21:40         ` Or Gerlitz
2018-05-20 22:43           ` Marcelo Ricardo Leitner
2018-05-14 14:27 ` [PATCH 14/14] net: sched: implement delete for all actions Vlad Buslov
2018-05-16  9:48   ` Jiri Pirko
2018-05-16  9:58     ` Vlad Buslov
2018-05-19 22:45       ` Marcelo Ricardo Leitner
2018-05-14 18:03 ` [PATCH 00/14] Modify action API for implementing lockless actions Jamal Hadi Salim
2018-05-14 20:46   ` Vlad Buslov
2018-05-15 18:25     ` Jamal Hadi Salim
2018-05-15 21:21       ` Vlad Buslov
2018-05-15  8:20   ` Jiri Pirko
2018-05-24 23:34 ` Cong Wang
2018-05-25 20:39   ` Vlad Buslov
2018-05-25 21:40     ` Cong Wang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAM_iQpUKxY1jc9mfNYfd+0wy_Oe7xttHXazg3SU=8Doq+0uoZg@mail.gmail.com' \
    --to=xiyou.wangcong@gmail.com \
    --cc=ast@kernel.org \
    --cc=coreteam@netfilter.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kadlec@blackhole.kfki.hu \
    --cc=keescook@chromium.org \
    --cc=kliteyn@mellanox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=vladbu@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).