Atomic Buffered Writes: Linux Kernel Aims to Solve Database Corruption Risk with 'Writethrough'

By

Breaking: Linux Developers Tackle Atomic Write Problem for Databases

At the 2026 Linux Storage, Filesystem, Memory Management, and BPF Summit, kernel developers debated a new approach to atomic buffered writes—a feature critical for preventing database corruption. The two-session discussion centered on a proposal to use writethrough caching, which forces data to disk immediately instead of waiting for page cache writeback.

Atomic Buffered Writes: Linux Kernel Aims to Solve Database Corruption Risk with 'Writethrough'

In the opening session, Pankaj Raghav and Andres Freund set the stage with a use case from PostgreSQL. 'Without atomic buffered writes, a crash during a write operation can leave database pages half-written, leading to silent corruption,' said Freund, a core PostgreSQL developer. 'This is a pain point for many production deployments.'

Background

Atomic buffered writes aim to guarantee that multiple block writes to disk are completed as a single, indivisible operation. The Linux kernel's standard buffered I/O, which stores data temporarily in the page cache, breaks this atomicity—a write can be split into smaller chunks and partially flushed, leaving inconsistent data after a power loss.

The problem has long plagued database systems, which rely on atomic writes for transaction safety. PostgreSQL, for example, uses double-write buffers to work around the issue, but this adds overhead. The summit sessions explored how to integrate atomicity into the kernel's buffered I/O path.

Key Proposal: Writethrough

In the second session, Ojaswin Mujoo presented a way forward using writethrough. Instead of caching writes in the page cache and deferring writeback, the kernel would immediately initiate disk I/O for each buffered write, ensuring that data is durable before acknowledging completion. 'Writethrough can provide atomicity without requiring complex page cache modifications,' Mujoo explained.

However, developers raised concerns about performance. 'Writethrough eliminates the latency benefits of buffering,' noted one attendee. Mujoo countered that the approach could be selectively applied to specific files or workloads, such as database WAL (write-ahead log) files, where atomicity matters more than raw throughput.

Discussion Highlights

The combined storage and filesystem track sparked debate on implementation trade-offs. Some advocated for a more comprehensive solution involving per-page atomicity in the page cache itself, while others favored the simplicity of writethrough. 'There’s no one-size-fits-all answer,' said a filesystem maintainer. 'But we need to move forward to unblock database performance.'

Developers agreed to prototype the writethrough approach in a file-level fallback, with plans to benchmark it against real-world workloads like PostgreSQL and MySQL.

What This Means

If successful, atomic buffered writes could eliminate the double-write buffer overhead in databases, improving write speeds by up to 30% in some configurations. For cloud providers running thousands of database instances, the energy and cost savings would be significant.

Beyond databases, the feature could benefit any application requiring crash-safe file I/O, from journaling file systems to container runtimes. The next step is a reference implementation, expected for review in the Linux 6.12 development cycle.

Expert Quotes

Andres Freund: 'The storage community is finally converging on a solution that has been demanded for years.'
Ojaswin Mujoo: 'Writethrough is a pragmatic first step. We can refine it as we learn.'

Stay tuned for follow-up reports from the summit.

Related Articles

Recommended

Discover More

Ubuntu Pro Finds a Streamlined Home in the Security CenterHow to Spot and Avoid Fake Call History Apps on Google Play: A Security GuideHow to Understand and Respond to the EPA's New Flaring Guidance for Oil and Gas OperationsDeepSeek Unveils Blueprint for Cost-Effective AI Scaling in New Hardware-Aware Training PaperSeamlessly Migrate from CocoaPods to Swift Package Manager in Flutter