netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] [RFC] nf_tables: speed up rule addition and deletion
@ 2012-11-01 16:02 pablo
  2012-11-01 16:02 ` [PATCH 1/2] netfilter: nf_tables: use 64-bits rule handle instead of 16-bits pablo
  2012-11-01 16:02 ` [PATCH 2/2] netfilter: nf_tables: improve deletion performance pablo
  0 siblings, 2 replies; 6+ messages in thread
From: pablo @ 2012-11-01 16:02 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Tomasz Bursztyka

From: Pablo Neira Ayuso <pablo@netfilter.org>

Hi!

The following two RFC patches aim to improve rule addition and
deletion timing.

The current major bottleneck in the rule addition is the handle
allocation per chain which is O(n), a simple way to get it O(1)
is to use a 64-bits handle instead of 16-bits to uniquely identify
the rule.

The main concern here is to avoid wrap around of the handle
(so we have no two rules with the same handle). We could stick
to 32-bits. Overrun would happen after 2^32 rule additions, that
seems unlikely but still possible in scenario in which rules
are dynamically added and deleted.

Regarding deletion, as it was documented in the source code,
synchronize_rcu() really make performance suck. The alternative
is to use kfree_rcu() and add one struct rcu_head per rule. This
increases the length of the rule structure.

I didn't come with any better simple solution like these two.

I think this is yet another space-time tradeoff thing. So I'd put
pressure on the memory side at this moment.

Comments welcome.

-- 
1.7.10.4


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

end of thread, other threads:[~2012-11-05 10:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-01 16:02 [PATCH 0/2] [RFC] nf_tables: speed up rule addition and deletion pablo
2012-11-01 16:02 ` [PATCH 1/2] netfilter: nf_tables: use 64-bits rule handle instead of 16-bits pablo
2012-11-01 16:02 ` [PATCH 2/2] netfilter: nf_tables: improve deletion performance pablo
2012-11-02  9:05   ` Tomasz Bursztyka
2012-11-04 18:44     ` Pablo Neira Ayuso
2012-11-05 10:16       ` Tomasz Bursztyka

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).