2003-02-21 21:47:20

by Yours Lovingly

[permalink] [raw]
Subject: strange but consistent feature of linux nfs client

Hi,
The linux nfs client (at least the one in 2.4.19)
shows one characteristic :
Consider a client side benchmark that creates a file
across nfs, writes some data into it, reads this data
back, modifies it and writes it back, finally reading
it again and closing. (Assume that there isn't any
other client operating on this nfs mounted filesystem
that could pose a threat to the cached data validity
on our client)
Thus the order is like :
write-read-write-read

I observed without exception in all test runs that the
second write-read combination had the read succeeding
to find the data in the local cache(after suitable
revalidation etc) while the first read operation in
each individual test run never found the data in the
local cache(although the first write too like the
second write was done through the pagecache) or
whatever but invariably made an on the wire read -
always.

So what is special - first time reads/first time
writes and why,
and how is this speciality affected in the kernel.

thanks a lot
Abhishek

________________________________________________________________________
Missed your favourite TV serial last night? Try the new, Yahoo! TV.
visit http://in.tv.yahoo.com


2003-02-21 22:09:37

by Trond Myklebust

[permalink] [raw]
Subject: Re: strange but consistent feature of linux nfs client

>>>>> " " == Yours Lovingly <[email protected]> writes:

> I observed without exception in all test runs that the second
> write-read combination had the read succeeding to find the data
> in the local cache(after suitable revalidation etc) while the
> first read operation in each individual test run never found
> the data in the local cache(although the first write too like
> the second write was done through the pagecache) or whatever
> but invariably made an on the wire read - always.

> So what is special - first time reads/first time writes and
> why, and how is this speciality affected in the kernel.

You are perhaps failing to write an entire page?

Cheers,
Trond