Re: [PATCH] zerocopy NFS updated

David S. Miller (davem@redhat.com)
Thu, 11 Apr 2002 04:36:14 -0700 (PDT)


From: Hirokazu Takahashi <taka@valinux.co.jp>
Date: Thu, 11 Apr 2002 20:38:23 +0900 (JST)

Hmmm... If I'd implement them.....
How about following codes ?

nfsd read()
{
:
page_cache_get(page);
if (page is mapped to anywhere)
page = duplicate_and_rehash(page);
else {
page_lock(page);
page->flags |= COW;
page_unlock(page);
}
sendpage(page);
page_cache_release(page);
}

What if a process mmap's the page between duplicate_and_rehash and the
card actually getting the data?

This is hopeless. The whole COW idea is 1) expensive 2) complex to
implement.

This is why we don't implement sendfile with anything other than a
simple page reference. Otherwise the overhead and complexity is
unacceptable.

No, you must block truncate operations on the file until the client
ACK's the nfsd read request if you wish to use sendfile() with
nfsd.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/