From: Charles Manning Subject: Page cache and write Date: Tue, 20 May 2003 08:13:45 +1200 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <20030519201144.4DA04437A@blood.actrix.co.nz> Reply-To: manningc2@actrix.gen.nz Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Return-path: Received: from blood.actrix.co.nz ([203.96.16.160]:50632 "EHLO blood.actrix.co.nz") by vger.kernel.org with ESMTP id S262577AbTEST6s (ORCPT ); Mon, 19 May 2003 15:58:48 -0400 Received: from there (203-96-48-201-tollfree.actrix.co.nz [203.96.48.201]) by blood.actrix.co.nz (Postfix) with SMTP id 4DA04437A for ; Tue, 20 May 2003 08:11:44 +1200 (NZST) To: linux-fsdevel@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org When writing the YAFFS NAND file system, I added an internal caching layer that caches both short reads and writes. This is used in most situations, but not in Linux. Under Linux, YAFFS uses generic_file_read and generic_file_write and thus any caching is provided bythe page cache. It was my understanding that the page cache will cache up writes. However, from the experiences of some YAFFS users this is not the case and enabling the YAFFS internal caching resulted in dramatic speedup (eg 15 seconds-> 3 seconds for a certain code sequence). I now want to understand whether I should enable internal caching in YAFFS or whether I should be using the page cache differently. Consider the code for(i=0; i < 1000; i++) write(f,b,1); On a flash file system this would take a long time if each write goes all the way to the fs. I assume too that this code does not result in 1000 disk writes on a regular file system (eg ext2). Questions: Does the page cache do anything to help in this case? Question: Assuming ext2 does not do 1000 physical writes to disk, where does the consolidation happen? Thanx -- Charles.