Subject: Re: filesystem read-ahead caching....
To: NetBSD Kernel Technical Discussion List <tech-kern@NetBSD.ORG>
From: Chuck Silvers <>
List: tech-kern
Date: 05/03/2001 20:53:58
all of the filesystems now do read ahead and write behind with clustering.
the cluster_{read,write}() code is not used anymore since that code deals
with the buffer cache and regular file data is no longer stored in the
buffer cache.  for read ahead, look in genfs_getpages() where it calls
VOP_GETPAGES() recursively.

LFS will be converted to use the page cache for file data as well once
I finish with the code I'm working on now to enable that.  so far I'm
still working on implementing pmap_{kenter_pa,kremove} in more pmaps
(since that is required by my new code), but hopefully I'll get to
LFS before too much longer.  once LFS is converted, vfs_cluster.c
can be deleted since it won't be used anymore.


On Thu, May 03, 2001 at 10:07:11PM -0400, Greg A. Woods wrote:
> [ On Thursday, May 3, 2001 at 16:01:21 (-0700), Jason R Thorpe wrote: ]
> > Subject: Re: filesystem read-ahead caching....
> >
> > If you were looking at -current, then it's because the clustering is
> > now all done with UBC (using the "clustered pageout" stuff in the
> > pageout daemon).
> Yes, I'm looking at -current...
> But (for FFS) that's just for writing, no?  I want read-ahead too!!!  :-)
> Maybe I'm looking in the wrong place, but I only see cluster_read()
> called if LFS_READWRITE is defined in sys/ufs/ufs_readwrite.c, and if I
> understand that #ifdef correctly the code it wraps (when defined) is
> intended only for when that file is used to build the LFS stuff
> (i.e. when it's included in lfs_vnops.c).
> There's a comment about setting doclusterread being "underway" in
> ext2fs/ext2fs_readwrite.c, but even there it doesn't seem to work yet.
> Unless there's some other #define that renames some identifier to be
> cluster_read() (eg. to replace bread as the comment above the function
> definition in vfs_cluster.c suggests) I don't see anything else that'll
> enable read-ahead for FFS.
> BUT, it doesn't seem like it should be that hard to enable, particularly
> given the comments in vfs_cluster.c, which is why I ask....
> In fact it almost looks like the one place cluster_read() is called when
> LFS_READWRITE is defined would be the only place it needs to be called
> for FFS too....
> -- 
> 							Greg A. Woods
> +1 416 218-0098      VE3TCP      <>     <>
> Planix, Inc. <>;   Secrets of the Weird <>