Eric Dumazet
255d0dc340
netfilter: x_table: speedup compat operations
...
One iptables invocation with 135000 rules takes 35 seconds of cpu time
on a recent server, using a 32bit distro and a 64bit kernel.
We eventually trigger NMI/RCU watchdog.
INFO: rcu_sched_state detected stall on CPU 3 (t=6000 jiffies)
COMPAT mode has quadratic behavior and consume 16 bytes of memory per
rule.
Switch the xt_compat algos to use an array instead of list, and use a
binary search to locate an offset in the sorted array.
This halves memory need (8 bytes per rule), and removes quadratic
behavior [ O(N*N) -> O(N*log2(N)) ]
Time of iptables goes from 35 s to 150 ms.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com >
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org >
2011-01-13 12:05:12 +01:00
..
2011-01-13 10:30:29 +09:00
2011-01-13 10:29:21 +09:00
2010-10-25 13:58:36 -07:00
2010-07-23 12:59:36 +02:00
2010-06-25 14:46:56 +02:00
2010-05-13 15:02:08 +02:00
2011-01-13 10:29:21 +09:00
2010-08-19 17:18:01 -07:00
2011-01-13 10:29:21 +09:00
2010-11-15 19:45:13 +01:00
2010-05-13 15:02:08 +02:00
2010-06-10 23:31:35 -07:00
2010-11-15 19:45:13 +01:00
2010-05-13 15:02:08 +02:00
2010-06-10 23:31:35 -07:00
2011-01-13 10:29:21 +09:00
2010-11-12 17:33:17 +01:00
2010-11-12 17:33:17 +01:00
2010-11-12 17:33:17 +01:00
2010-11-15 19:45:13 +01:00
2010-10-21 08:21:34 -07:00
2011-01-13 10:29:21 +09:00
2010-05-13 15:02:08 +02:00
2010-05-13 15:02:08 +02:00
2010-11-15 18:17:21 +01:00
2010-11-15 18:17:21 +01:00
2010-10-21 08:21:34 -07:00
2010-11-15 18:17:21 +01:00
2010-06-15 13:49:24 -07:00
2010-05-13 15:02:08 +02:00
2011-01-13 12:05:12 +01:00
2010-07-15 17:20:46 +02:00
2010-11-15 13:57:56 +01:00
2010-06-08 16:09:52 +02:00
2010-05-11 18:33:37 +02:00
2010-06-25 14:44:07 +02:00
2010-05-11 18:35:27 +02:00
2010-05-11 18:33:37 +02:00
2010-05-11 18:31:17 +02:00
2011-01-13 12:05:12 +01:00
2010-07-23 12:59:36 +02:00
2010-10-21 10:12:48 +11:00
2010-05-11 18:35:27 +02:00
2010-05-11 18:33:37 +02:00
2010-05-11 18:31:17 +02:00
2010-05-11 18:35:27 +02:00
2010-08-19 17:16:25 -07:00
2010-05-11 18:33:37 +02:00
2010-05-11 18:33:37 +02:00
2010-05-11 18:31:17 +02:00
2010-06-22 08:13:31 +02:00
2010-05-11 18:33:37 +02:00
2011-01-13 10:30:27 +09:00
2010-05-11 18:31:17 +02:00
2010-05-11 18:33:37 +02:00
2010-05-11 18:33:37 +02:00
2010-05-11 18:33:37 +02:00
2010-05-11 18:33:37 +02:00
2010-05-11 18:35:27 +02:00
2010-05-11 18:31:17 +02:00
2010-11-12 17:34:17 +01:00
2010-06-08 16:09:52 +02:00
2010-05-11 18:33:37 +02:00
2010-05-11 18:33:37 +02:00
2010-05-11 18:33:37 +02:00
2010-05-11 18:33:37 +02:00
2010-05-11 18:33:37 +02:00
2010-07-23 14:07:47 +02:00
2010-05-11 18:33:37 +02:00
2010-06-11 18:37:08 -07:00
2010-05-11 18:33:37 +02:00
2010-10-15 15:53:27 +02:00
2010-06-09 14:47:40 +02:00
2010-10-21 10:12:48 +11:00
2010-10-28 12:59:53 -07:00
2010-06-08 16:09:52 +02:00
2010-06-01 12:00:41 +02:00
2010-05-11 18:33:37 +02:00
2010-05-11 18:35:27 +02:00
2010-06-15 11:56:19 -07:00
2010-05-11 18:31:17 +02:00
2010-05-11 18:35:27 +02:00
2010-11-17 12:27:45 -08:00
2010-05-13 15:16:27 +02:00
2010-10-25 13:58:36 -07:00
2010-05-11 18:31:17 +02:00
2010-05-11 18:33:37 +02:00