Longtime LWN readers will have encountered the concept of “stable pages” before; it was first covered here nearly 15 years ago. For the most part, the problem that stable pages were meant to solve — preventing errors when user space modifies a buffer that is under I/O — has been dealt with. But recent discussions show that there is one area where problems remain: direct I/O. There is some disagreement, though, over whether those problems are the result of user-space bugs and how much of a performance price should be paid to address them.
Writing a page of data to a block storage device takes time. If a process tells the kernel to perform a write, some time will thus pass before the operation is complete. Should that process modify the under-I/O data while it is being written, the result is a sort of data race with the usual unpredictable results. Either the old or the new data could end up being written; in the worst case, a combination of the old and new data could be written, corrupting the file.

