From: Stephen Hemminger <stephen@networkplumber.org>
To: Florian Westphal <fw@strlen.de>
Cc: Thomas Graf <tgraf@suug.ch>, Cong Wang <cwang@twopensource.com>,
"Kirill A. Shutemov" <kirill@shutemov.name>,
"David S. Miller" <davem@davemloft.net>,
netdev <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: mmap()ed AF_NETLINK: lockdep and sleep-in-atomic warnings
Date: Tue, 14 Jul 2015 11:40:40 -0700 [thread overview]
Message-ID: <20150714114040.58dd5bf5@urahara> (raw)
In-Reply-To: <20150714095037.GB25674@breakpoint.cc>
On Tue, 14 Jul 2015 11:50:37 +0200
Florian Westphal <fw@strlen.de> wrote:
> Thomas Graf <tgraf@suug.ch> wrote:
> > On 07/13/15 at 10:11pm, Cong Wang wrote:
> > > Caused by:
> > >
> > > commit 21e4902aea80ef35afc00ee8d2abdea4f519b7f7
> > > Author: Thomas Graf <tgraf@suug.ch>
> > > Date: Fri Jan 2 23:00:22 2015 +0100
> > >
> > > netlink: Lockless lookup with RCU grace period in socket release
> > >
> > > Defers the release of the socket reference using call_rcu() to
> > > allow using an RCU read-side protected call to rhashtable_lookup()
> > >
> > > This restores behaviour and performance gains as previously
> > > introduced by e341694 ("netlink: Convert netlink_lookup() to use
> > > RCU protected hash table") without the side effect of severely
> > > delayed socket destruction.
> > >
> > > Signed-off-by: Thomas Graf <tgraf@suug.ch>
> > > Signed-off-by: David S. Miller <davem@davemloft.net>
> > >
> > >
> > > We can't hold mutex lock in a rcu callback, perhaps we could
> > > defer the mmap ring cleanup to a workqueue.
> >
> > The socket should be dead at this point. It might be simpler to
> > add a netlink_release_ring() function which doesn't require
> > locking at all. It would also get rid of all the special handling
> > for closing vs. non-closing.
>
> Do you know of any users of mmap'd netlink?
> Support for this was never added to libmnl; given the fact that netlink
> mmap doesn't have any advantages vs. socket interface i'd just revert it
> (or mark CONFIG_NETLINK_MMAP broken -- although I don't see
> how the unconditional copy on tx could ever be avoided).
We use netlink mmap because it gives slightly better performance
when processing a route flap.
prev parent reply other threads:[~2015-07-14 18:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-13 13:18 mmap()ed AF_NETLINK: lockdep and sleep-in-atomic warnings Kirill A. Shutemov
2015-07-14 5:11 ` Cong Wang
2015-07-14 9:38 ` Thomas Graf
2015-07-14 9:50 ` Florian Westphal
2015-07-14 18:40 ` Stephen Hemminger [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=20150714114040.58dd5bf5@urahara \
--to=stephen@networkplumber.org \
--cc=cwang@twopensource.com \
--cc=davem@davemloft.net \
--cc=fw@strlen.de \
--cc=kirill@shutemov.name \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=tgraf@suug.ch \
/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).