By "extremely slow" do you mean "tape read speed"?
So, you need to
a) make your stager daemon do IO more sensibly, and
b) apply something like this patch which adds O_NONBLOCK when knfsd does
reads writes and truncates and translates -EAGAIN into NFS3ERR_JUKEBOX
http://kerneltrap.org/mailarchive/linux-fsdevel/2006/5/5/312567
and
c) make your filesystem IO interposing layer report -EAGAIN when a
process tries to do IO to an offline region in a file and O_NONBLOCK is
present.
I think having a tunable for client readahead is an excellent idea,
although not to solve your particular problem. The SLES10 kernel has a
patch which does precisely that, perhaps Neil could post it.
I don't think there's a lot of point having both a module parameter and
a sysctl.
A maximum of 15 is unwise. I've found that (at least with the older
readahead mechanisms in SLES10) a multiple of 4 is required to preserve
rsize-alignment of READ rpcs to the server, which helps a lot with wide
RAID backends. So in SGI we tune client readahead to 16.
Your patch seems to have a bunch of other unrelated stuff mixed in.
--
Greg Banks, P.Engineer, SGI Australian Software Group.
Be like the squirrel.
I don't speak for SGI.
--