From: Peter Staubach Subject: Re: [PATCH] read-modify-write page updating Date: Thu, 09 Jul 2009 09:59:18 -0400 Message-ID: <4A55F7B6.80800@redhat.com> References: <49FA0CE8.9090706@redhat.com> <1241126587.15476.62.camel@heimdal.trondhjem.org> <1243615595.7155.48.camel@heimdal.trondhjem.org> <1243618500.7155.56.camel@heimdal.trondhjem.org> <1243686363.5209.16.camel@heimdal.trondhjem.org> <1243963631.4868.124.camel@heimdal.trondhjem.org> <18982.41770.293636.786518@fisica.ufpr.br> <1244049027.5603.5.camel@heimdal.trondhjem.org> <1244138698.5203.59.camel@heimdal.trondhjem.org> <4A428482.60403@redhat.com> <1245950029.4913.17.camel@heimdal.trondhjem.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Cc: Brian R Cowan , linux-nfs@vger.kernel.org To: Trond Myklebust Return-path: Received: from mx2.redhat.com ([66.187.237.31]:41489 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759129AbZGIN7Y (ORCPT ); Thu, 9 Jul 2009 09:59:24 -0400 In-Reply-To: <1245950029.4913.17.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org> Sender: linux-nfs-owner@vger.kernel.org List-ID: 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