Speaker
Description
Manual management of resources, from locks to reference counts, is a persistent source of bugs, resource leaks, and reduced code robustness. Scope-based resource management, offers a far more reliable approach by automatically releasing resources when they fall out of scope.
This session will demonstrate the practical application of Coccinelle to automate the transition to scope-based cleanup. We will present examples of our semantic patches (SmPL).
This technique has already been successfully applied to numerous locking and reference counter patterns, improving code clarity and removing a substantial number of manual cleanup blocks across the kernel. While effective, the approach is not without its challenges.
We will discuss current limitations, including how to handle complex nested cleanup scenarios and resources with non-trivial teardown logic.
We invite developers to collaborate on refining these SmPL patterns and extending their capabilities, with the goal of expanding this automated cleanup strategy across the kernel.