From mboxrd@z Thu Jan 1 00:00:00 1970 From: Badari Pulavarty Subject: Re: Lazy block allocation and block_prepare_write? Date: Tue, 19 Apr 2005 09:59:18 -0700 Message-ID: <426538E6.2050700@us.ibm.com> References: <8e70aacf05041717546fdff3f@mail.gmail.com> <42647484.5040208@us.ibm.com> <16996.59873.671294.982899@gargle.gargle.HOWL> <1113921972.26913.417.camel@dyn318077bld.beaverton.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: Nikita Danilov , fsdevel Return-path: Received: from e3.ny.us.ibm.com ([32.97.182.143]:5279 "EHLO e3.ny.us.ibm.com") by vger.kernel.org with ESMTP id S261546AbVDSQ7b (ORCPT ); Tue, 19 Apr 2005 12:59:31 -0400 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e3.ny.us.ibm.com (8.12.11/8.12.11) with ESMTP id j3JGxUQh027071 for ; Tue, 19 Apr 2005 12:59:30 -0400 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay02.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j3JGxUkH068802 for ; Tue, 19 Apr 2005 12:59:30 -0400 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.12.11/8.12.11) with ESMTP id j3JGxTrg016250 for ; Tue, 19 Apr 2005 12:59:29 -0400 To: Alex Tomas In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Alex Tomas wrote: >>>>>>Nikita Danilov (ND) writes: > > > >>> > In order to do the correct accounting, we need to mark a page > >>> > to indicate if we reserved a block or not. One way to do this, > >>> > to use page->private to indicate this. But then, all the generic > >>> > >>> I believe one can use PG_mappedtodisk bit in page->flags for this > >>> purpose. There was old Andrew Morton's patch that introduced new bit > >>> (PG_delalloc?) for this purpose. > >> > >> That would be good. But I don't feel like asking for a bit in page > >> if there is a way to get around it. > > ND> Clarification: PG_mappedtodisk is already here, it seems you can reuse > ND> this already existing bit to implement delayed allocation support. > > I think we need another one, because mappedtodisk != reserved. we could use > mappedtodisk, but this means in ->commit_write() we'd need to check that one > more time (first time in ->prepare_write()) Yep. We need one more to indicate the we reserved a block for this page. Other option I was thinking on how to avoid is, by "reserving" a block when a mapped page changes from read -> write. Andrew's -mm tree has patch to give us a notification when it happens. Thanks, Badari