Writing Sequentially and Effectively
This lesson describes how LFS uses write buffering to ensure efficient writes.
We'll cover the following
Write buffering
Unfortunately, writing to disk sequentially is not (alone) enough to guarantee efficient writes. For example, imagine if we wrote a single block to address , at time . We then wait a little while and write to the disk at address (the next block address in sequential order), but at time . In-between the first and second writes, unfortunately, the disk has rotated. When you issue the second write, it will thus wait for most of a rotation before being committed (specifically, if the rotation takes time , the disk will wait before it can commit the second write to the disk surface). And thus you can hopefully see that simply writing to disk in sequential order is not enough to achieve peak performance. Rather, you must issue a large number of contiguous writes (or one large write) to the drive in order to achieve good write performance.
To achieve this end, LFS uses an ancient technique known as write buffering.
Get hands-on with 1400+ tech skills courses.