|
|
Log in / Subscribe / Register

Cleaning up after BPF exceptions

Cleaning up after BPF exceptions

Posted Apr 16, 2024 10:56 UTC (Tue) by roc (subscriber, #30627)
Parent article: Cleaning up after BPF exceptions

It's interesting that BPF continues to evolve away from static cleanup checking to dynamic cleanup-on-unwind. I expect BPF will converge on a model where any BPF function can throw at specified cancellation points, where every loop and function call includes at least one cancellation point, and unwinding due to throw can release any/all resources. At that point, there's no need for BPF programs to include code to specifically release those resources, so some kind of scope mechanism will be introduced to trigger cleanup automatically on non-throwing paths (e.g. function returns). Static checking of termination will be completely superseded by dynamic counting of instructions or blocks triggering an interrupt at the next cancellation point. Unsurprisingly it will look more and more like a conventional virtual machine with RAII.


The LWN site is currently under high scraper load, so comment display has been suppressed for anonymous users. If you are a human, you may read the comments by clicking the button below:

Note: you can avoid this step in the future by logging into your LWN account.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds