Re: [PATCH] zerocopy NFS updated

Hirokazu Takahashi
2002-04-11T07:41:39Z

Hi,

davem> Consider truncate() to 1 byte left in that page. To handle mmap()'s
davem> of this file the kernel will memset() rest of the page to zero.
davem> Now, in the sendfile() case the NFS client sees some page filled
davem> mostly of zeros instead of file contents.

Hmmm... I realize clearly.

davem> In sendmsg() knfd case, client sees something reasonable. He will
davem> see something that was actually in the file at some point in time.
davem> The sendfile() case sees pure garbage, contents that never were in
davem> the file at any point in time.
davem>
davem> We could make knfsd take the write semaphore on the inode until client
davem> is known to get the packet but that is the kind of overhead we'd like
davem> to avoid.

Yes, the write semaphore would be good solution if TCP/IP stack never
get stuck.

Now I wonder if we could make these pages COW mode.
When some process try to update the pages, they should be duplicated.
I's easy to implement it in write(), truncate() and so on.
But mmap() is little bit difficult if there no reverse mapping page to PTE.

How do you think about this idea?

Regards,
Hirokazu Takahashi