Async I/O
Async I/O
Posted Apr 8, 2009 0:29 UTC (Wed) by bojan (subscriber, #14302)In reply to: Async I/O by NAR
Parent article: Linux Storage and Filesystem workshop, day 1
One could also solve the problem that fbarrier() is meant to solve by using aio_fsync(). If aio_fsync() was designed to wait for the regular kernel commit interval in laptop mode (which it could, because there are no guarantees when it's going to complete), application writers could just use that to provide safe rename. The actual rename would be called from signal handler or the thread created when aio_fsync() completes.
In other words, no new calls would need to be introduced into the kernel, the apps would be portable and safe, interactivity would be preserved (this is an async interface), one would not need to use extra threads (signal can be delivered instead) and disk would not need to spin up to commit the file right away.
At the same time, regular fsync() would still mean "really commit now", so databases and similar software could use it safely even in laptop mode.
