From: "Aneesh Kumar K.V" Subject: Re: ftruncate-mmap: pages are lost after writing to mmaped file. Date: Thu, 26 Mar 2009 13:48:43 +0530 Message-ID: <20090326081843.GA8207@skywalker> References: <604427e00903181244w360c5519k9179d5c3e5cd6ab3@mail.gmail.com> <200903200248.22623.nickpiggin@yahoo.com.au> <20090319164638.GB3899@duck.suse.cz> <200903241844.22851.nickpiggin@yahoo.com.au> <20090324123935.GD23439@duck.suse.cz> <20090324125510.GA9434@duck.suse.cz> <20090324132637.GA14607@duck.suse.cz> <1237903305.17910.4.camel@think.oraclecorp.com> <20090324140720.GE23439@duck.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Chris Mason , Nick Piggin , "Martin J. Bligh" , linux-ext4@vger.kernel.org, Ying Han , Linus Torvalds , Andrew Morton , linux-kernel , linux-mm , guichaz@gmail.com, Alex Khesin , Mike Waychison , Rohit Seth , Peter Zijlstra To: Jan Kara Return-path: Content-Disposition: inline In-Reply-To: <20090324140720.GE23439@duck.suse.cz> Sender: owner-linux-mm@kvack.org List-Id: linux-ext4.vger.kernel.org On Tue, Mar 24, 2009 at 03:07:21PM +0100, Jan Kara wrote: > On Tue 24-03-09 10:01:45, Chris Mason wrote: > > On Tue, 2009-03-24 at 14:26 +0100, Jan Kara wrote: > > > On Tue 24-03-09 13:55:10, Jan Kara wrote: > > > > > > And one more interesting thing I don't yet fully understand - I see pages > > > > having PageError() set when they are removed from page cache (and they have > > > > been faulted in before). It's probably some interaction with pagecache > > > > readahead... > > > Argh... So the problem seems to be that get_block() occasionally returns > > > ENOSPC and we then discard the dirty data (hmm, we could give at least a > > > warning for that). I'm not yet sure why getblock behaves like this because > > > the filesystem seems to have enough space but anyway this seems to be some > > > strange fs trouble as well. > > > > > > > Ouch. Perhaps the free space is waiting on a journal commit? > Yes, exactly. I've already found there's lot of space hold by the > committing transaction (it can easily hold a few hundred megs or a few gigs > with larger journal and my UML images aren't that big...). And writepage() > implementation in ext3 does not have a logic to retry. Also > block_write_full_page() clears buffers dirty bits so it's not easy to retry > even if we did it. I'm now looking into how to fix this... We retry block allocation in ext3_write_begin. And for mmap we should be doing something similar to ext4_page_mkwrite so that we can be sure that during writepage we don't need to do block allocation. -aneesh -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org