OpenCloudOS-Kernel/drivers/isdn/i4l
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
..
Kconfig isdn: fix a few Kconfig imperfections 2010-02-22 15:45:53 -08:00
Makefile ISDN: Make isdnhdlc usable for other ISDN drivers 2009-07-25 20:15:21 +02:00
isdn_audio.c Update broken web addresses in the kernel. 2010-10-18 11:03:14 +02:00
isdn_audio.h
isdn_bsdcomp.c [ISDN]: Get rid of some pointless allocation casts in common and bsd comp. 2007-08-26 18:35:46 -07:00
isdn_common.c isdn: autoconvert trivial BKL users to private mutex 2010-07-12 20:21:47 -07:00
isdn_common.h
isdn_concap.c drivers/isdn/i4l: Remove unnecessary casts of netdev_priv 2010-11-17 10:36:50 -08:00
isdn_concap.h
isdn_net.c drivers/isdn/i4l: Remove unnecessary casts of netdev_priv 2010-11-17 10:36:50 -08:00
isdn_net.h isdn: fix possible circular locking dependency 2009-10-22 18:27:53 -07:00
isdn_ppp.c filter: optimize sk_run_filter 2010-11-19 09:49:59 -08:00
isdn_ppp.h
isdn_tty.c i4l: kill big kernel lock 2010-09-15 19:29:55 -07:00
isdn_tty.h Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
isdn_ttyfax.c tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
isdn_ttyfax.h
isdn_v110.c isdn: replace __inline with inline 2008-03-05 18:37:39 -08:00
isdn_v110.h
isdn_x25iface.c X25: Use identifiers for isdn device to x25 interface 2010-04-22 16:12:48 -07:00
isdn_x25iface.h
isdnhdlc.c ISDN: Fix isdnhdlc for one byte hdlc packets 2009-07-25 20:16:17 +02:00