https://en.wikipedia.org/wiki/Berkeley_Packet_Filter - with information on the basics of eBPF
"In his linux.conf.au 2017 talk on the eBPF in-kernel virtual machine, Brendan Gregg proclaimed that "super powers have finally come to Linux". Getting eBPF to that point has been a long road of evolution and design. While eBPF was originally used for network packet filtering, it turns out that running user-space code inside a sanity-checking virtual machine is a powerful tool for kernel developers and production engineers.
-- LWN.net: A thorough introduction to eBPF
The big performance advantage is that context switches are reduced.
More recently, the use of eBPF has been expanded. A couple of insightful videos;
How to Make Linux Microservice-Aware with Cilium and eBPF - first half is a good eBPF overview, the second half relates to security, specifically in-kernel application level firewall rules.
LPC2018 - When eBPF meets FUSE: Improving Performance of User File Systems - user space filesystems in the kernel
So my wonder is this; could eBPF be used for in-kernel audio DSP?
See also https://github.com/iovisor/bcc and https://github.com/zoidbergwill/awesome-ebpf
eBPF and in-kernel audio DSP?
Moderators: MattKingUSA, khz
- milkii
- Established Member
- Posts: 477
- Joined: Tue Jan 05, 2016 9:08 am
- Location: Edinburgh
- Has thanked: 92 times
- Been thanked: 91 times
- Contact:
eBPF and in-kernel audio DSP?
they/them ta / libreav.org / wiki.thingsandstuff.org/Audio and related pages / gh
Re: eBPF and in-kernel audio DSP?
I think you can use kernel_fpu_begin/kernel_fpu_end around dsp code in a kernel thread since at least kernel 2.6, even directly in the interrupt thread of your sound device.
- milkii
- Established Member
- Posts: 477
- Joined: Tue Jan 05, 2016 9:08 am
- Location: Edinburgh
- Has thanked: 92 times
- Been thanked: 91 times
- Contact:
Re: eBPF and in-kernel audio DSP?
they/them ta / libreav.org / wiki.thingsandstuff.org/Audio and related pages / gh
- bluebell
- Established Member
- Posts: 1924
- Joined: Sat Sep 15, 2012 11:44 am
- Location: Saarland, Germany
- Has thanked: 112 times
- Been thanked: 119 times
Re: eBPF and in-kernel audio DSP?
Not sure if that's a good idea:
- It's just-in-time-compiled code, so it's hardly slower but in no case faster than compiled code in user space. No win here.
- Communication with code in user space (DAW) would not be obsolete, so it's basically similar to today's architecture.
- It can run code in user space but it's designed to run in kernel space: one more place where user supplied code could possibly destabilize the whole machine's operation.One more threat here.
Sure,it's a new toy. But will it enable anything usable? Or will it just blow up the kernel a bit more?
- It's just-in-time-compiled code, so it's hardly slower but in no case faster than compiled code in user space. No win here.
- Communication with code in user space (DAW) would not be obsolete, so it's basically similar to today's architecture.
- It can run code in user space but it's designed to run in kernel space: one more place where user supplied code could possibly destabilize the whole machine's operation.One more threat here.
Sure,it's a new toy. But will it enable anything usable? Or will it just blow up the kernel a bit more?
Linux – MOTU UltraLite AVB – Qtractor – http://suedwestlicht.saar.de/