[ECOS] blib node allocation problem with FAT FS

Steve West swest@cyglan.com
Wed Feb 27 17:02:00 GMT 2008


> On Wed, Feb 27, 2008 at 09:06:42AM -0500, Steve West wrote:
>> Hi all,
>>    I am having some problems with blib node allocation. It seems that the
>> number of unique file names is controlled by node pool size. If I set
>> NODE_POOL_SIZE to 32k and then open and close 32k unique named files I
>> get a file open failure around 32k files. Any ideas?
>
> Could you produce a little test case which demonstrates the problem?
> If you follow the usual test case style i will include it as a
> standard test so that once we have the problem fixed we can also use
> it for regression testing.
>
I found the problem. The reference count was decrementing below 0. Here is a 
fix for fatfs_node_unref() in fatfs_ncache.c.

  if (node->refcnt)
        node->refcnt--;

I also found that if you change the 512 to 32768 (sector size) in fatfs.c 
call to cyg_blib_io_create() you get a 50% - 60% increase in disk 
throughput, especially with large files. (driver reads writes clusters not 
sectors)

Steve


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list