// the find
davideleoni90/LinuxSessionSemantics
Linux Kernel Programming project: add session semantics for file I/O to Linux Kernel 2.6.34
A Linux kernel module from a 2016 university course at Sapienza that adds session semantics to file I/O on kernel 2.6.34. When you open a file with the SESSION_OPEN flag, your writes go to a private in-memory buffer and only flush back to disk when you close the file. It's a didactic exercise in kernel module development, not a production tool.
Implements a genuinely interesting concurrency model — last-writer-wins at session close rather than at each write. Syscall hooking approach (replacing open with a custom wrapper) is a clean way to add opt-in semantics without breaking existing callers. Module ref-counting on session open/close is correctly handled to prevent unloading under active sessions. Use cases directory has concrete test programs covering the main scenarios.
Kernel 2.6.34 is from 2010 and this will not compile on any modern kernel without significant rework — syscall table patching via CR0 write-protect tricks were partially locked down in later kernels. The last-writer-wins flush on close is a data loss landmine: two concurrent sessions on the same file means whoever closes last silently overwrites the other's changes with no conflict detection. Bypassing the page cache entirely means you lose readahead, dirty page coalescing, and any benefit from OS-level caching — memory usage scales with file size per session. Zero stars, no maintenance since 2016, and explicitly scoped to one course assignment.