From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sean Young Subject: Re: [RFC PATCH] forget block layer request for FTLs Date: Sun, 27 Nov 2005 18:54:16 +0100 Message-ID: <20051127175416.GA55520@atlantis.8hz.com> References: <20051124132157.GA16439@atlantis.8hz.com> <200511251336.41191.manningc2@actrix.gen.nz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org Return-path: Received: from atlantis.8hz.com ([212.129.237.78]:52211 "EHLO atlantis.8hz.com") by vger.kernel.org with ESMTP id S1751125AbVK0RyT (ORCPT ); Sun, 27 Nov 2005 12:54:19 -0500 To: Charles Manning Content-Disposition: inline In-Reply-To: <200511251336.41191.manningc2@actrix.gen.nz> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Fri, Nov 25, 2005 at 01:36:41PM +1300, Charles Manning wrote: > Being a bit of a flash-head, I find this RPC quite interesting. I am > struggling though to see exactly where this is going to be used. I don't think I explained it very well. Allow my to try again. A normal block device like a harddisk can overwrite (write-in-place) sectors; however flash has larger erase units than the sector size (512) which makes this impossible. This problem is handled by the flash translation layer (FTL). It has a layer of indirection which stores sectors a different location on the flash, along with a table of sector number and an address on the flash memory chip. When a sector is overwritten it saves it a different location and updates the table. When no free space exists any more on the flash, it needs to make an entire erase unit available for erase. To achieve this, it moves around sectors while updating the table for consistency. The problem I'm trying to solve is that the FTL is unaware of sectors which are no longer relevant, sectors of deleted files for example. Those sectors do not need to be moved, they can simply be "forgotten", causing the flash memory to fill up less quickly before another erase is necessary. Also, by "forgetting" sectors an erase unit might become available for erase without requiring moving of sectors, allowing the erase to happen before the flash memory is full. So, it makes FTL faster and the flash last longer. I hope this clears things up. Sean