From: Patrick McHardy <kaber@trash.net>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Florian Westphal <fw@strlen.de>, Eric Leblond <eric@regit.org>,
sclark46@earthlink.net, Kuzin Andrey <kuzinandrey@yandex.ru>,
Anders Nilsson Plymoth <lanilsson@gmail.com>,
netfilter-devel <netfilter-devel@vger.kernel.org>,
netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH 1/2] nfnetlink: add RCU in nfnetlink_rcv_msg()
Date: Tue, 05 Jul 2011 15:22:33 +0200 [thread overview]
Message-ID: <4E131019.8020200@trash.net> (raw)
In-Reply-To: <1309534078.2599.25.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>
On 01.07.2011 17:27, Eric Dumazet wrote:
> Le vendredi 01 juillet 2011 à 09:49 +0200, Florian Westphal a écrit :
>> Eric Dumazet <eric.dumazet@gmail.com> wrote:
>>> Number one offender is the nfnl_lock mutex hold each time we give a
>>> verdict.
>>
>> Yes, the nfnl mutex is fairly annoying for nfqueue.
>>
>> Unfortunately it is not possible to just remove it
>> completely since it also protects against module removal.
>>
>
> I believe it can, just add appropriate synchronization points.
>
>> But I guess even having to grab a refcount would be
>> a huge win as opposed to holding on to the nfnl mutex...
>>
>> We'd also need to audit all ->call implementations; most
>> of them assume the nfnl_mutex is being hold.
>
> CC netdev
>
> We can do another way : Introduce a new ->call_rcu() implementation
> and convert places where we prefer not holding nfnf_mutex.
>
> If/when all places are converted, remove the ->call() field for good.
We've talked about this a few times, but we have some pretty deep
call chains especially in ctnetlink, which are using sleeping
allocations. Not sure whether we really want to convert those.
An alternative would be to push locking down one level and have
the subsystem decide whether to use RCU or the mutex. However that
would require taking a reference to the subsystem in nfnetlink to
avoid module unloda races.
> With following two patches, I was able to reach more than 2.000.000 pps
> without losses on my setup (limited by my lab setup), instead of less
> than 500.000 pps
That sounds pretty impressive.
next prev parent reply other threads:[~2011-07-05 13:22 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-29 9:17 netfilter queue throughput slowdown Anders Nilsson Plymoth
2011-06-29 9:47 ` Eric Dumazet
2011-06-29 9:55 ` Anders Nilsson Plymoth
2011-06-29 10:08 ` Eric Dumazet
2011-06-30 6:20 ` Kuzin Andrey
2011-06-30 6:47 ` Eric Dumazet
2011-06-30 7:36 ` Kuzin Andrey
2011-06-30 11:34 ` Eric Dumazet
2011-06-30 11:59 ` Patrick McHardy
2011-06-30 15:15 ` Eric Dumazet
2011-06-30 14:32 ` Stephen Clark
2011-06-30 14:51 ` Patrick McHardy
2011-06-30 17:07 ` Eric Leblond
2011-06-30 17:45 ` Eric Dumazet
2011-06-30 18:08 ` Eric Leblond
2011-07-01 6:39 ` Amos Jeffries
2011-07-01 7:00 ` [RFC] nfnetlink_queue not scalable Eric Dumazet
2011-07-01 7:49 ` Florian Westphal
2011-07-01 15:27 ` [PATCH 1/2] nfnetlink: add RCU in nfnetlink_rcv_msg() Eric Dumazet
2011-07-01 14:11 ` Florian Westphal
2011-07-05 13:22 ` Patrick McHardy [this message]
2011-07-18 14:06 ` Patrick McHardy
2011-07-01 15:08 ` netfilter queue throughput slowdown Anders Nilsson Plymoth
2011-06-30 22:24 ` Sam Roberts
2011-07-01 4:53 ` Eric Dumazet
2011-06-30 22:26 ` Sam Roberts
2011-07-01 4:52 ` Eric Dumazet
2011-07-02 12:25 ` Pablo Neira Ayuso
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=4E131019.8020200@trash.net \
--to=kaber@trash.net \
--cc=eric.dumazet@gmail.com \
--cc=eric@regit.org \
--cc=fw@strlen.de \
--cc=kuzinandrey@yandex.ru \
--cc=lanilsson@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=sclark46@earthlink.net \
/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).