public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: "Jürgen Lambrecht" <jurgen.lambrecht2@telenet.be>
To: ecos-discuss@ecos.sourceware.org
Subject: [ECOS] Re: FTP runs out of JFFS2 nodes and trashes the file system
Date: Mon, 07 Apr 2008 23:22:00 -0000	[thread overview]
Message-ID: <47FAAC06.9010509@telenet.be> (raw)
In-Reply-To: <47FA32AC.4070705@televic.com>

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

       reply	other threads:[~2008-04-07 23:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <47FA32AC.4070705@televic.com>
2008-04-07 23:22 ` Jürgen Lambrecht [this message]
2008-04-08  6:48   ` Andrew Lunn
2008-04-08  8:41     ` Jürgen Lambrecht
2008-04-08 10:32       ` Andrew Lunn
2008-04-08 15:58         ` Jürgen Lambrecht
2008-04-09 11:42         ` Jürgen Lambrecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47FAAC06.9010509@telenet.be \
    --to=jurgen.lambrecht2@telenet.be \
    --cc=ecos-discuss@ecos.sourceware.org \
    --cc=j.lambrecht@televic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).