tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: any interest in JIT for bpf and npf_ncode?



Hi,

Recent commit by rmind@ prompted me to give update on my stuff.

I mostly finished NetBSD integration about a month ago but due to a lack
of time I could neither finish my work nor report my progress on the list.

I introduced a new BPFJIT option to the kernel and added two new
kernel modules: sljit and bpfjit.

sljit.kmod  is 34K on amd64
bpfjit.kmod is 12K on amd64

If you compile the kernel with BPFJIT option, you can start running
bpfjit code for new filters when you load bpfjit modules. There is
no sysctl option to turn it on or off.

The modules are always compiled regardless of BPFJIT option on supported
arches. At the moment it's only amd64 because I can't test it on other
arches but it should also work on arm (I tested my stuff in usermode on
armv7l linux), i386, mips and ppc.

I wrote many micro-tests for usermode but they don't use ATF. Converting
them to ATF should not be difficult.

Alex

Alexander Nasonov wrote:
> Hi,
> 
> I've been playing with sljit in the last few days. SLJIT stands for
> state-less just-in-time compiler and it supports the following
> architectures (from sljit.sf.net):
> 
> Intel x86-32
> AMD x86-64
> ARM (Including ARM-v5, ARM-v7 and Thumb2 instruction sets)
> IBM PowerPC-32
> IBM PowerPC-64
> MIPS-32
> 
> I implemented code generation for some bpf instructions. The supported
> set is rich enough to measure a performance of a real (well, almost)
> bpf program. JIT code is 3-4 times faster on Ubuntu armv7 and 4.5 times
> faster on NetBSD-current amd64.
> 
> Code is available on github: https://github.com/alnsn/bpfjit
> 
> Is there is interest, I can look into porting sljit to the kernel and
> adding npf_ncode.
> 
> Alex
> 

-- 


Home | Main Index | Thread Index | Old Index