From: Cong Wang <xiyou.wangcong@gmail.com>
To: John Fastabend <john.fastabend@gmail.com>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Jamal Hadi Salim <jhs@mojatatu.com>,
Chris Mi <chrism@mellanox.com>,
Linux Kernel Network Developers <netdev@vger.kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Eric Dumazet <edumazet@google.com>,
David Miller <davem@davemloft.net>, Jiri Pirko <jiri@resnulli.us>
Subject: Re: Get rid of RCU callbacks in TC filters?
Date: Thu, 19 Oct 2017 20:15:41 -0700 [thread overview]
Message-ID: <CAM_iQpW90BZaKHkFhvuYJLWDg85m6ec7secv3whc5emy7EfsMQ@mail.gmail.com> (raw)
In-Reply-To: <52808e54-2f59-49c8-37be-d226e79fe286@gmail.com>
On Thu, Oct 19, 2017 at 8:34 AM, John Fastabend
<john.fastabend@gmail.com> wrote:
>
> My take on this would be to stay with the current RCU callbacks and try
> to simplify the implementation. Falling back to sync operations seems
> like a step backwards to me. I know update/delete of filters is currently
> a pain point for some use cases so getting the RTNL out of the way may
> become a requirement to support those (alternatively maybe batching is
> good enough).
For me it looks like very hard to make tc action destroy code completely
race-free in RCU callbacks, at least looks harder than getting rid of
RCU callbacks.
>
> I guess at a high level with Cris' patches actions are now doing reference
> counting correctly. If shared filters also do reference counting similarly
> we should be OK right? (yes I know simplifying maybe too much to be
> meaningful)
I don't know what you mean by "doing reference counting correctly",
if you mean making them atomic, as I already explained to Chris, it
is not necessary at all if we remove RCU callbacks. Refcnt doesn't
have to be atomic if it is always serialized with a lock.
>
> Are we aware of any outstanding problem areas?
>
Potentially many problems, since tc action destroy code could be
called either with a RTNL lock (fine) or in a RCU callback without
RTNL lock (buggy), these two paths race with each other and RCU
callbacks race among themselves too.
next prev parent reply other threads:[~2017-10-20 3:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-18 17:36 Get rid of RCU callbacks in TC filters? Cong Wang
2017-10-18 19:35 ` Paul E. McKenney
2017-10-19 15:34 ` John Fastabend
2017-10-20 3:15 ` Cong Wang [this message]
2017-10-20 3:26 ` Cong Wang
2017-10-20 16:56 ` Paul E. McKenney
2017-10-20 20:31 ` Cong Wang
2017-10-20 20:52 ` Cong Wang
2017-10-23 11:10 ` David Laight
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_iQpW90BZaKHkFhvuYJLWDg85m6ec7secv3whc5emy7EfsMQ@mail.gmail.com \
--to=xiyou.wangcong@gmail.com \
--cc=chrism@mellanox.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=john.fastabend@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.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).