This looks very similar to webassembly work going on right now, both use a secure VM, and both run in kernel space. Would webassembly be a more general purpose way of accomplishing something like this?
BPF: A New Type of Software
61–70 of 192 posts
Re: BPF: A New Type of Software
#62The Lost Generation discovers IBM Mainframe Channel Programs? Want to bet if they are going to make all the same mistakes themselves, or if they are willing to learn from history?
Re: BPF: A New Type of Software
#63Earlier quoted context omitted.
A BPF interpreter can literally be ~100 LoC. A WebAssembly VM on the other hand will likely be ~1million LoC (without checking). One is suitable for embedding into a kernel, the other isn't.
Where did you get ~1million number? https://github.com/bytecodealliance/wasm-micro-runtime is less than 100K LoC for example.
Re: BPF: A New Type of Software
#64[0] http://www.brendangregg.com/flamegraphs.html
Re: BPF: A New Type of Software
#65Can someone write an ELI5 of BPF, please?
Re: BPF: A New Type of Software
#66Earlier quoted context omitted.
A BPF interpreter can literally be ~100 LoC. A WebAssembly VM on the other hand will likely be ~1million LoC (without checking). One is suitable for embedding into a kernel, the other isn't.
Where did you get ~1million number? https://github.com/bytecodealliance/wasm-micro-runtime is less than 100K LoC for example.
Re: BPF: A New Type of Software
#67Question from me, why reinvent the bicycle and not just write proper kernel modules in C?
BPF is completely production safe. So there is no way for a BPF program to crash the kernel, introduce significant performance latency, or have any side effects on the kernel/user space. Obviously, kernel modules have none of those properties. Also, BPF has been around for almost 30 years, and you're likely using it. tcpdump is basically just a BPF bytecode frontend, for example.
This additionally removes the need to have the bpf compiler in the kernel, reducing both core size and vulnerability surface area.
No reason BPF must imply JIT
Re: BPF: A New Type of Software
#68Question from me, why reinvent the bicycle and not just write proper kernel modules in C?
Re: BPF: A New Type of Software
#69Earlier quoted context omitted.
A BPF interpreter can literally be ~100 LoC. A WebAssembly VM on the other hand will likely be ~1million LoC (without checking). One is suitable for embedding into a kernel, the other isn't.
> One is suitable for embedding into a kernel, the other isn't. I'd be very surprised if the linux kernel doesn't eventually get web assembly support.
Re: BPF: A New Type of Software
#70Earlier quoted context omitted.
Where did you get ~1million number? https://github.com/bytecodealliance/wasm-micro-runtime is less than 100K LoC for example.
If a micro runtime is 100K LOC then 1M LOC wasn't unrealistic.