From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13443 invoked by alias); 7 Apr 2008 23:20:06 -0000 Received: (qmail 13432 invoked by uid 22791); 7 Apr 2008 23:20:05 -0000 X-Spam-Check-By: sourceware.org Received: from wilson.telenet-ops.be (HELO wilson.telenet-ops.be) (195.130.132.42) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 07 Apr 2008 23:19:38 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by wilson.telenet-ops.be (Postfix) with SMTP id EC4B634011 for ; Tue, 8 Apr 2008 01:19:35 +0200 (CEST) Received: from [127.0.0.1] (78-20-170-12.access.telenet.be [78.20.170.12]) by wilson.telenet-ops.be (Postfix) with ESMTP id A48D03400E for ; Tue, 8 Apr 2008 01:19:35 +0200 (CEST) Message-ID: <47FAAC06.9010509@telenet.be> Date: Mon, 07 Apr 2008 23:22:00 -0000 From: =?ISO-8859-1?Q?J=FCrgen_Lambrecht?= Reply-To: j.lambrecht@televic.com User-Agent: Thunderbird 1.5.0.14 (Windows/20071210) MIME-Version: 1.0 To: ecos-discuss@ecos.sourceware.org References: <47FA32AC.4070705@televic.com> In-Reply-To: <47FA32AC.4070705@televic.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: [ECOS] Re: FTP runs out of JFFS2 nodes and trashes the file system X-SW-Source: 2008-04/txt/msg00124.txt.bz2 Hello, I have the problem that I cannot FTP more than 200 files at once to my board. It always fails with this message: arena=301672, uordblks=30728, fordblks=270924, maxfree=261196. arena=301672, uordblks=41160, fordblks=260492, maxfree=260188. arena=301672, uordblks=44808, fordblks=256844, maxfree=252148. arena=301672, uordblks=46000, fordblks=255652, maxfree=252148. arena=301672, uordblks=49176, fordblks=252476, maxfree=240948. Unable to allocate raw_node_ref count=16000 Unable to allocate raw_node_ref count=16000 Unable to allocate raw_node_ref count=16000 arena=301672, uordblks=47552, fordblks=254100, maxfree=245340. - My raw node data structures (jffs2_raw_node_ref) are of course statically allocated - CYGNUM_FS_JFFS2_RAW_NODE_REF_CACHE_POOL_SIZE is set to 16000. (This needs 250kB; the user can use 55MB, so with 4kB nodes, I have 1920 free nodes for smaller nodes at the end of a file.) Compression is disabled (as I mainly store mp3 files). I put the CYGNUM_IO_FILEIO_MAX_INODE_CACHE_DEAD = 0. - In jffs2/../malloc-ecos.c I added a counter as you can see in the log above. In this test, after FTP'ing 189 files with in total 3706kB, the file system crashes, but in a "valid" way: indeed, as the counter proofs, the raw node pool is empty, *but how is this possible?* Therefore my question about FTP in http://ecos.sourceware.org/ml/ecos-discuss/2008-04/msg00110.html. I have to unmount/mount or reboot to be able to delete files again. If I then don't delete but add files instead, it fails with the same error after a few files. When I repeat this cycle of reboot-add files a few times (depending on previous state of the file system) *jffs2 "crashes"*: I cannot anymore delete or add any file - listing directories still works, also the application still runs. I have to format the flash to solve the problem. - When I do the same test with TFTP, I can put over 1000 files in 1 directory (and then TFTP times out because jffs2 becomes too slow with so many files in the directory). Mark: the test is reproducible, independent of the SW and HW. - I use now the flash-v2 driver to avoid problems with the main cvs tree non-interrupt save driver. But I read this in the documentation: "However the library may not be interrupt safe. An interrupt must not cause execution of code that is resident in FLASH." If I understand it well, *this means the library is thread safe on the condition that all code is always executed in RAM?* This is ok in my case. - Our ftp server code is based on the Minimal FTP server from Matthias Wandel. After a TCP connect, we just have a loop that calls: recv(socket,buf,...); fwrite(buf,...);. I use FTP client in Total Commander. - My board has a 32MHz AT91M55800A ARM7TDMI processor, with external 1MB SRAM and 64MB flash of which 61MB is in a jffs2 partition. Please don't remind me that my amount of SRAM is not enough ;-). But as you can see in the log, I still have enough heap. - Maybe this is a *timing issue*, as jffs2 needs more time the more full the file system gets? Kind regards, Juergen -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss