Eric Dumazet
93aaae2e01
filter: optimize sk_run_filter
...
Remove pc variable to avoid arithmetic to compute fentry at each filter
instruction. Jumps directly manipulate fentry pointer.
As the last instruction of filter[] is guaranteed to be a RETURN, and
all jumps are before the last instruction, we dont need to check filter
bounds (number of instructions in filter array) at each iteration, so we
remove it from sk_run_filter() params.
On x86_32 remove f_k var introduced in commit 57fe93b374
(filter: make sure filters dont read uninitialized memory)
Note : We could use a CONFIG_ARCH_HAS_{FEW|MANY}_REGISTERS in order to
avoid too many ifdefs in this code.
This helps compiler to use cpu registers to hold fentry and A
accumulator.
On x86_32, this saves 401 bytes, and more important, sk_run_filter()
runs much faster because less register pressure (One less conditional
branch per BPF instruction)
# size net/core/filter.o net/core/filter_pre.o
text data bss dec hex filename
2948 0 0 2948 b84 net/core/filter.o
3349 0 0 3349 d15 net/core/filter_pre.o
on x86_64 :
# size net/core/filter.o net/core/filter_pre.o
text data bss dec hex filename
5173 0 0 5173 1435 net/core/filter.o
5224 0 0 5224 1468 net/core/filter_pre.o
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com >
Acked-by: Changli Gao <xiaosuo@gmail.com >
Signed-off-by: David S. Miller <davem@davemloft.net >
2010-11-19 09:49:59 -08:00
..
2010-10-27 19:04:36 -07:00
2010-10-18 15:16:08 +02:00
2010-10-20 15:38:23 -07:00
2010-10-20 15:37:28 -07:00
2010-11-03 10:44:20 -07:00
2010-10-13 07:49:27 -07:00
2010-10-29 00:30:24 +02:00
2010-10-26 17:54:22 -07:00
2010-11-04 12:21:25 +09:00
2010-10-30 08:31:35 -07:00
2010-10-23 11:47:02 -07:00
2010-10-13 18:00:51 +02:00
2010-10-18 11:22:05 +02:00
2010-10-13 18:00:51 +02:00
2010-10-13 18:00:51 +02:00
2010-10-28 22:40:31 +01:00
2010-11-01 07:50:43 -04:00
2010-11-02 17:13:52 -04:00
2010-11-05 14:13:32 +02:00
2010-10-15 21:18:59 +02:00
2010-10-26 14:51:00 -04:00
2010-10-22 10:20:08 -07:00
2010-10-21 20:21:03 -04:00
2010-11-12 07:55:30 -08:00
2010-10-30 08:45:43 -04:00
2010-10-26 16:52:10 -07:00
2010-10-27 18:03:06 -07:00
2010-10-25 04:54:25 -04:00
2010-11-10 14:54:09 +01:00
2010-11-15 13:27:04 -05:00
2010-11-10 14:54:09 +01:00
2010-11-10 14:54:09 +01:00
2010-10-25 21:18:20 -04:00
2010-10-27 18:03:09 -07:00
2010-10-25 08:02:40 -07:00
2010-10-25 08:02:40 -07:00
2010-10-25 08:02:40 -07:00
2010-10-26 17:32:41 -07:00
2010-10-24 14:20:01 -07:00
2010-10-14 14:32:06 -07:00
2010-11-15 07:12:00 +01:00
2010-10-22 10:16:43 -07:00
2010-10-07 17:08:32 -07:00
2010-10-21 14:23:48 -07:00
2010-10-14 18:38:42 +02:00
2010-10-14 18:38:20 +02:00
2010-10-22 15:55:22 +02:00
2010-10-22 17:03:12 -07:00
2010-10-21 14:47:59 +02:00
2010-10-24 22:06:02 +02:00
2010-10-21 01:26:54 -07:00
2010-10-23 09:24:34 +09:00
2010-10-28 17:22:16 -04:00
2010-10-27 18:03:08 -07:00
2010-10-18 11:03:14 +02:00
2010-11-19 09:49:59 -08:00
2010-10-31 06:35:15 -07:00
2010-10-22 10:22:17 -07:00
2010-10-28 17:22:16 -04:00
2010-10-30 14:07:40 -04:00
2010-10-24 22:06:02 +02:00
2010-10-26 16:52:10 -07:00
2010-10-25 14:11:37 -07:00
2010-11-02 08:39:13 -04:00
2010-10-23 22:49:32 +02:00
2010-11-12 07:55:30 -08:00
2010-10-12 16:53:37 +02:00
2010-10-08 09:32:46 +02:00
2010-10-31 21:06:59 +01:00
2010-10-26 17:40:56 -07:00
2010-10-11 15:04:21 -04:00
2010-10-05 20:26:58 -07:00
2010-11-15 11:13:16 -08:00
2010-10-18 11:03:14 +02:00
2010-11-17 11:28:25 -08:00
2010-11-16 10:58:30 -08:00
2010-11-12 12:30:57 -08:00
2010-11-18 09:33:19 -08:00
2010-10-21 16:08:28 +02:00
2010-11-17 11:28:25 -08:00
2010-10-27 18:03:12 -07:00
2010-10-22 10:21:26 -07:00
2010-11-03 11:04:46 -07:00
2010-10-07 15:03:44 -07:00
2010-10-27 18:48:00 -07:00
2010-10-26 16:52:08 -07:00
2010-11-11 13:40:11 +01:00
2010-10-26 15:33:31 -07:00
2010-10-21 16:08:28 +02:00
2010-10-18 19:58:50 +02:00
2010-10-26 10:33:27 +02:00
2010-10-12 16:53:44 +02:00
2010-10-07 14:08:55 +01:00
2010-10-28 11:58:39 +02:00
2010-10-27 21:25:12 -04:00
2010-10-18 19:58:57 +02:00
2010-10-29 14:45:29 -04:00
2010-10-28 17:22:13 -04:00
2010-10-22 15:34:12 -05:00
2010-10-27 18:03:13 -07:00
2010-11-12 07:55:32 -08:00
2010-10-27 18:03:18 -07:00
2010-10-29 13:14:41 -05:00
2010-10-22 10:16:44 -07:00
2010-10-24 12:47:25 -07:00
2010-10-24 10:50:49 +02:00
2010-10-24 10:52:19 +02:00
2010-11-12 07:55:32 -08:00
2010-11-12 07:55:32 -08:00
2010-11-12 07:55:32 -08:00
2010-10-21 21:18:54 -04:00
2010-10-25 14:11:39 -07:00
2010-10-25 21:24:15 -04:00
2010-10-21 14:11:46 -07:00
2010-10-28 09:08:47 -05:00
2010-10-29 13:50:25 -07:00
2010-10-26 16:52:19 -07:00
2010-10-12 15:37:51 -07:00
2010-10-26 16:52:06 -07:00
2010-10-22 10:16:44 -07:00
2010-10-08 09:32:46 +02:00
2010-10-26 16:52:05 -07:00
2010-10-26 16:52:09 -07:00
2010-10-28 09:02:15 -07:00
2010-10-26 16:52:07 -07:00
2010-10-08 10:46:27 +02:00
2010-10-26 16:52:13 -07:00
2010-10-12 16:53:34 +02:00
2010-10-08 17:16:22 -05:00
2010-10-18 11:03:14 +02:00
2010-10-04 21:10:52 +02:00
2010-10-04 21:10:52 +02:00
2010-11-15 11:13:17 -08:00
2010-11-17 10:54:34 -08:00
2010-10-18 08:32:07 -07:00
2010-10-26 09:55:25 -07:00
2010-10-24 18:07:10 -04:00
2010-10-26 09:52:09 -07:00
2010-10-07 18:48:49 -04:00
2010-10-24 18:07:10 -04:00
2010-10-23 09:24:39 +09:00
2010-11-15 13:24:10 -05:00
2010-10-21 11:10:10 -06:00
2010-10-21 11:10:10 -06:00
2010-10-21 11:34:55 -06:00
2010-10-12 21:58:08 -06:00
2010-10-17 01:57:50 +02:00
2010-10-15 12:45:44 +02:00
2010-10-25 16:10:15 +02:00
2010-10-26 16:52:05 -07:00
2010-10-26 16:52:09 -07:00
2010-10-31 21:06:59 +01:00
2010-10-17 20:03:03 -07:00
2010-10-17 20:03:06 -07:00
2010-10-27 21:30:13 -04:00
2010-10-27 17:53:25 +02:00
2010-10-22 17:31:36 -07:00
2010-11-10 22:58:39 +01:00
2010-10-13 14:40:34 -07:00
2010-10-24 15:07:11 -07:00
2010-10-22 10:16:42 -07:00
2010-10-17 01:57:48 +02:00
2010-10-17 01:57:43 +02:00
2010-10-17 01:57:48 +02:00
2010-10-27 18:03:18 -07:00
2010-10-06 17:37:22 +04:00
2010-10-27 18:03:10 -07:00
2010-11-12 07:55:33 -08:00
2010-11-12 07:55:32 -08:00
2010-10-29 04:16:31 -04:00
2010-10-27 18:03:18 -07:00
2010-10-26 16:52:16 -07:00
2010-10-05 14:03:02 -07:00
2010-10-25 21:18:20 -04:00
2010-11-12 07:55:30 -08:00
2010-10-17 01:57:50 +02:00
2010-11-15 13:24:06 -05:00
2010-10-20 13:37:56 -04:00
2010-10-27 18:03:16 -07:00
2010-10-27 18:03:16 -07:00
2010-10-27 18:03:16 -07:00
2010-10-26 16:52:09 -07:00
2010-10-05 00:29:48 -07:00
2010-10-30 11:50:37 -07:00
2010-10-21 10:12:50 +11:00
2010-10-22 10:20:06 -07:00
2010-10-21 10:12:48 +11:00
2010-10-30 12:12:50 +02:00
2010-10-22 10:20:10 -07:00
2010-10-25 13:46:56 -07:00
2010-10-18 09:33:31 -07:00
2010-10-18 23:57:06 -04:00
2010-11-08 09:35:26 +09:00
2010-10-26 16:05:08 +09:00
2010-10-31 10:40:39 -04:00
2010-10-08 09:32:15 +02:00
2010-10-20 03:02:23 -07:00
2010-10-06 16:54:36 +03:00
2010-10-21 15:44:13 +02:00
2010-10-27 17:28:36 +01:00
2010-10-28 11:47:52 -07:00
2010-10-07 14:08:55 +01:00
2010-10-14 08:55:28 +02:00
2010-10-17 01:57:49 +02:00
2010-10-26 16:52:05 -07:00
2010-10-27 18:03:14 -07:00
2010-10-27 18:03:10 -07:00
2010-10-17 01:57:44 +02:00
2010-10-14 12:41:10 -07:00
2010-10-21 04:11:07 -07:00
2010-10-27 18:03:12 -07:00
2010-10-22 10:20:04 -07:00
2010-11-09 14:36:23 -08:00
2010-10-26 16:52:03 -07:00
2010-10-22 10:16:43 -07:00
2010-10-22 10:22:05 -07:00
2010-11-08 12:28:32 -08:00
2010-10-21 13:45:28 -02:00
2010-10-21 07:55:58 -02:00
2010-10-27 18:03:18 -07:00
2010-10-26 16:52:10 -07:00
2010-10-05 11:47:18 -07:00
2010-10-13 15:45:21 -04:00
2010-11-15 13:25:02 -05:00
2010-10-26 16:52:14 -07:00
2010-10-30 09:05:48 -07:00