[Ocfs2-tools-devel] [PATCH 04/13] libocfs2: Large I/Os in the cache.

Sunil Mushran sunil.mushran at oracle.com
Tue Jun 2 15:44:36 PDT 2009


Joel Becker wrote:
> Our I/O cache is dumb.  It works one block at a time.  We really want
> large I/Os to go out like that.
>
> We change the write case to write the I/O first, as big as it can.  Then
> it runs through each completed block and updates the cache.  If there
> was a short write, it will still update the cache for the blocks that
> were written.
>
> The read code has even more smarts.  First, it checks to see if the
> entire read is in cache.  If not, it does I/O from the start of the
> first uncached block; it skips cached blocks at the front of the buffer.
> Then it runs through each block and syncs the cache to the buffer.
>
> We do the reads in 1MB hunks.  This gives us the opportunity to check
> for cached blocks every megabyte.  Imagine a 10MB buffer with only one
> uncached block - the very first one.  Doing it all at once will trigger
> a 10MB read.  But doing it in 1MB hunks will read the first 1MB, then
> discover the remaining 9MB are all in cache.
>
> Signed-off-by: Joel Becker <joel.becker at oracle.com>
>   

Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com>





More information about the Ocfs2-tools-devel mailing list