Lua in the kernel?
Lua in the kernel?
Posted Sep 9, 2020 17:37 UTC (Wed) by smurf (subscriber, #17840)Parent article: Lua in the kernel?
On the other hand, if nothing else running Lua is easily two orders of magnitude more accessible than BPF, to people who want to actually get things done instead of fighting with a BPF compiler and its limitations. (Been there, done that, thrown in the towel in favor of more satisfactory pursuits.) This alone is a rather powerful argument in favor of adding Lua IMHO.
Posted Sep 10, 2020 6:24 UTC (Thu)
by amarao (guest, #87073)
[Link] (2 responses)
Posted Sep 10, 2020 7:30 UTC (Thu)
by smurf (subscriber, #17840)
[Link]
Transitioning each and every message to userspace requires a context switch (and/or a cache transfer between CPUs) at minimum. That kills performance.
Posted Sep 10, 2020 7:30 UTC (Thu)
by edeloget (subscriber, #88392)
[Link]
(but for the record, I also think this is a hammer-based solution; there is a limit to what the kernel should do "in the name of performance"; does this announce the return of the HTTP server module?)
Posted Sep 12, 2020 13:11 UTC (Sat)
by foom (subscriber, #14868)
[Link] (1 responses)
The current state of things is really unfortunate, because you cannot _actually_ compile C to bpf. Well, rather, you can compile, but most nontrivial programs will be rejected by the bpf verifier when you try to load it into the kernel.
The verifier requires that all programs be statically analyzable to determine that the program will terminate, and that it is statically impossible for the program to ever access out of bounds memory. There is, by design, no runtime "failure" -- every bpf program that passes the verifier is guaranteed to terminate with a valid return value from the end of the program.
This is certainly an interesting property! But, this makes bpf very much not a generic architecture, and furthermore, impossible to reliably target with a C compiler. Even if you've carefully written your code to be verifier-safe, normal compiler optimizations may foil the static analysis, and break your program.
Yet, these verifier restrictions are not necessary -- *if* you're willing to admit the possibility of a program which can (safely!) fail to return a result when run.
Supporting Lua necessarily admits such a possibility of failure (e.g. by execution timeout, excessive memory allocation, etc etc). If that's acceptable, the same could surely be allowed for bpf, and result in a more generally usable system.
Posted Sep 18, 2020 9:29 UTC (Fri)
by HelloWorld (guest, #56129)
[Link]
http://docs.idris-lang.org/en/latest/tutorial/theorems.ht...
However while this does allow for more complex programs, I'm not sure how useful it is in practice at this time. For one, even if you prove that a program will run for a finite amount of time, that amount may well be longer than the age of the universe. These approaches also require additional training and education for programmers to use them effectively.
Lua in the kernel?
Lua in the kernel?
Lua in the kernel?
Lua in the kernel?
Lua in the kernel?
http://ats-lang.sourceforge.net/DOCUMENT/INT2PROGINATS/HT...
