Re: Quest: I/O prefetching experiment

Stephen C. Tweedie (sct@redhat.com)
Thu, 6 May 1999 18:57:23 +0100 (BST)


Hi,

On 05 May 1999 01:05:43 -0700, tmk@cse.ucsc.edu (Tom M. Kroeger) said:

> I am in the process of implementing an inter-file predictive
> prefetching policy.

Good!

> 1 - Where is the best place to prefetch the regular file data to,
> the page cache and/or the buffer cache?

Page cache: there's no question about it.

> My impression is that for regular file data the I should use the page
> cache, and for directory file data I should use the buffer cache.

> I am see cases where regular file data is found in the buffer
> cache but not in the page cache. How should this be happening
> if all regular file data reads go to pages in the page cache?

Anything left in the buffer cache will be a relic from previously
written data which hasn't yet been read: file writes are currently
handled with write-through to the buffer cache.

> 2 - What is the best way to prefetch directory file information if I
> know that a specific directory is about to be accessed?

unsigned long blocknr = bmap (dir, offset);
struct buffer_head *bh = getblk (dir->i_dev, blocknr, size);
if (!buffer_uptodate(bh))
ll_rw_block(READ, 1, &bh);

or some variation thereon.

--Stephen

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/