If you're reading sequential data from a file, modifying it and then writing it back sequentially in blocks, with the writes some distance behind the reads due to some kind of user space buffering scheme, then the I/O clustering facility isn't triggered. This hurts PostgreSQL, SQLite, and similar when they're rewriting a large table on a UFS filesystem.
Here's a patch to fix that by tracking sequential reads and write separately. It was written by Andrew Gierth back in 2008, and I've rebased it and hopefully improved it slightly.