From nakayama@pixela.co.jp Thu May 08 05:51:18 2008
Received: from smtp.pixela.co.jp ([210.189.30.129] helo=mx1.pixela.co.jp)
	by stoneboat.aleph1.co.uk with esmtp (Exim 4.63)
	(envelope-from <nakayama@pixela.co.jp>) id 1Jty61-0001QY-4k
	for yaffs@lists.aleph1.co.uk; Thu, 08 May 2008 05:51:18 +0100
Received: from mx1.pixela.co.jp (unknown [172.23.91.250])
	by mx1.pixela.co.jp (Postfix) with ESMTP id 2A26022801E
	for <yaffs@lists.aleph1.co.uk>; Thu,  8 May 2008 13:49:17 +0900 (JST)
Date: Thu, 08 May 2008 13:49:14 +0900
Message-ID: <uej8dienp.wl%nakayama@pixela.co.jp>
From: Yoichi NAKAYAMA <nakayama@pixela.co.jp>
To: yaffs@lists.aleph1.co.uk
User-Agent: Wanderlust/2.15.5 (Almost Unreal) EMIKO/1.14.1 (Choanoflagellata)
	LIMIT/1.14.10 (Furuichi) APEL/10.7 Emacs/22.1
	(i386-mingw-nt5.1.2600) MULE/5.0 (SAKAKI) Meadow/3.00-dev (KIKU)
Organization: Pixela Corporation
MIME-Version: 1.0 (generated by EMIKO 1.14.1 - "Choanoflagellata")
Content-Type: multipart/mixed; boundary="Multipart_Thu_May_08_13:49:14_2008-1"
X-SA-Exim-Connect-IP: 210.189.30.129
X-SA-Exim-Mail-From: nakayama@pixela.co.jp
X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on
	stoneboat.aleph1.co.uk
X-Spam-Level: 
X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_05 autolearn=ham
	version=3.2.3
X-SA-Exim-Version: 4.2.1 (built Tue, 09 Jan 2007 17:23:22 +0000)
X-SA-Exim-Scanned: Yes (on stoneboat.aleph1.co.uk)
Subject: [Yaffs] [PATCH] cooperate multitasking with yaffs1
X-BeenThere: yaffs@lists.aleph1.co.uk
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Discussion of YAFFS NAND flash filesystem <yaffs.lists.aleph1.co.uk>
List-Unsubscribe: <http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs>, 
	<mailto:yaffs-request@lists.aleph1.co.uk?subject=unsubscribe>
List-Archive: <http://lists.aleph1.co.uk/lurker/list/yaffs.html>
List-Post: <mailto:yaffs@lists.aleph1.co.uk>
List-Help: <mailto:yaffs-request@lists.aleph1.co.uk?subject=help>
List-Subscribe: <http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs>,
	<mailto:yaffs-request@lists.aleph1.co.uk?subject=subscribe>
X-List-Received-Date: Thu, 08 May 2008 04:51:18 -0000

--Multipart_Thu_May_08_13:49:14_2008-1
Content-Type: text/plain; charset=US-ASCII

Hi,
I run some application program, then mount yaffs1 partition
in background, I observed the application program is paused
until mount process is finished. The data scan loop takes too
long time, and there is YYIELD() in the corresponding part of
yaffs_ScanBackward() for yaffs2 partition.
I inserted schedule() at the beginning of data scan loop,
my problem disappeared. Is it a correct fix?
(patch against cvs head attached).

Best regards,
-- 
Yoichi NAKAYAMA
Pixela Corporation

--Multipart_Thu_May_08_13:49:14_2008-1
Content-Type: application/octet-stream; type=patch
Content-Disposition: attachment; filename="yaffs_guts.diff"
Content-Transfer-Encoding: 7bit

Index: yaffs_guts.c
===================================================================
RCS file: /home/aleph1/cvs/yaffs2/yaffs_guts.c,v
retrieving revision 1.55
diff -u -r1.55 yaffs_guts.c
--- yaffs_guts.c	5 May 2008 07:58:58 -0000	1.55
+++ yaffs_guts.c	8 May 2008 04:13:35 -0000
@@ -5568,6 +5568,10 @@
 	for (blockIterator = startIterator; !alloc_failed && blockIterator <= endIterator;
 	     blockIterator++) {
 
+	        /* Cooperative multitasking! This loop can run for so
+		   long that watchdog timers expire. */
+	        YYIELD();
+
 		if (dev->isYaffs2) {
 			/* get the block to scan in the correct order */
 			blk = blockIndex[blockIterator].block;

--Multipart_Thu_May_08_13:49:14_2008-1--

