Re: [PATCH] read-modify-write page updating

Peter Staubach
2009-07-09T13:59:24Z

Trond Myklebust wrote:
>
> It might also be nice to put the above test in a little inlined helper
> function (called nfs_want_read_modify_write() ?).
>
>

Good suggestion.

> So, a number of questions spring to mind:
>
> 1. What if we're extending the file? We might not need to read the
> page at all in that case (see nfs_write_end()).
>

Yup.

> 2. What if the page is already dirty or is carrying an uncommitted
> unstable write?
>

Yup.

> 3. We might want to try to avoid looping more than once here. If
> the kernel is very low on memory, we might just want to write
> out the data rather than read the page and risk having the VM
> eject it before we can dirty it.
>

Yup.

> 4. Should we be starting an async readahead on the next page?
> Single page sized reads can be a nuisance too, if you are
> writing huge amounts of data.

This one is tough. It sounds good, but seems difficult to implement.

I think that this could be viewed as an optimization.

ps