3 ms·
> This feature would work for mmap() regions as well, not just traditional write() calls. I always wondered about writable disk-backed pages -- back when I las
by wyldfire 7y ago
> This feature would work for mmap() regions as well, not just traditional write() calls.
I always wondered about writable disk-backed pages -- back when I last looked it up munmap() manpage made no suggestions about whether it would flush the data or whether you need an explicit msync() to make it happen. Since pages could get written back without an explicit msync(), it's always tricky to speculate how the behavior should be based on observation.
- namibj 7y agoRead the code. Only way to know for sure. Then use something maybe based on clang-query to check if the path that leads to flushing base on msync() and/or munmap() changed. Like, if any code between your syscall and the kernel-internal write-page-to-disk-now-i'm-waiting call changed. You should be able to convince clang-query to spit out a normalized AST of the code, and still be able to easily map it back to the source file location so you can check the source-file diff for the specifics once you demmed the AST diff ass non-trivial (some things should be easier to ignore in an AST diff). In case you end up creating such a tool, please share it with us.