public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* Re: [ECOS] Stress testing JFFS2
@ 2003-10-16  7:23 Øyvind Harboe
  2003-10-16  7:32 ` Andrew Lunn
  0 siblings, 1 reply; 22+ messages in thread
From: Øyvind Harboe @ 2003-10-16  7:23 UTC (permalink / raw)
  To: ecos-discuss

W.r.t. actual usage of JFFS2, here are the "parameters" for our usage:

- We need a capability to persit options(i.e. various named parameters 
that are anything from a couple of bytes to a couple of k in size).
These parameters are updated frequently during configuration phases and
only read during normal operation. The total number of files is ~10-30.
This configuration JFFS2 image is 6x64k. Possible alternative: Redboot
parameters?
- The configuration parameters are only read during startup. Afterwards,
it would be advantagous to flush all ram that JFFS2 is using. JFFS2 can
evidently rebuild the ram nodes more than quickly enough.
- During production we have a phase where the a second JFFS2 image is
modifyable(where we store, e.g. serial number). This JFFS2 image is
afterwards write protected in hardware. This JFFS2 image is 1x64k, hence
my previous posts about tricks to get JFFS2 to deal with this. Romdisks
could have been an alternative here, but the tools are designed to run
on the developer machine.

The needs above could be covered by other solutions. However, I like
JFFS2, because it is a generic solution.

I think the complete lists of tweaks to JFFS2 that I've had to do are:

- add option to disable compression. Saves ram. Flash is "cheap".
- allow JFFS2 to write to image when there are 0 free sectors. Allows
"ROM" scheme above + it fixes bugs that showed up in stress testing of
the 6x64k JFFS2 configuration image.
- GCC bug-fix. (Now comitted to eCos CVS, I think).
- Reboot after a couple of writes to JFFS2 to free up ram.


Øyvind



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

^ permalink raw reply	[flat|nested] 22+ messages in thread
* RE: [ECOS] Stress testing JFFS2
@ 2003-10-15 18:33 Doug Fraser
  0 siblings, 0 replies; 22+ messages in thread
From: Doug Fraser @ 2003-10-15 18:33 UTC (permalink / raw)
  To: 'Thomas Koeller'; +Cc: ecos-discuss

It becomes an interesting issue when you are using the FLASH
to store an actively updated database, which moves through
the FLASH arena at some slow but consistent rate.

Doug Fraser
dfraser@photuris.com

> -----Original Message-----
> From: Thomas Koeller [mailto:thomas.koeller@baslerweb.com]
> Sent: Wednesday, October 15, 2003 7:30 AM
> To: David Woodhouse
> Cc: ecos-discuss@sources.redhat.com; linux-mtd@lists.infradead.org
> Subject: Re: [ECOS] Stress testing JFFS2
> 
> 
> Hi David,
> 
> thanks for your quick response.
> 
> > All correct. But you miss the observation that we also keep a
> > raw_node_ref around for _obsolete_ nodes, which perhaps we 
> could avoid.
> > In fact, we do this because the raw_node_ref is in a 
> singly-linked list,
> > and it's going to be very inefficient to remove obsoleted nodes from
> > that list when they become obsolete.
> 
> I do not think this path leads anywhere I want to go. The flash size
> was chosen to meet the expected storage requirements, which means that
> at some point the flash will be filled with valid data and 
> consequently
> there will be few obsoleted nodes. I expect this to be true for most
> systems.
> 
> > Omitting the 'totlen' field should be relatively simple if 
> you're not
> > freeing obsolete refs. Observe that in 99% of cases, it's true that
> >
> > 	ref->totlen == ref_offset(ref->next_phys) - ref_offset(ref)
> >
> > Make it 100% and make me believe it, and you can remove 
> totlen from the
> > structure.
> >
> 
> I will consider that.
> 
> tk
> --------------------------------------------------
> 
> Thomas Koeller, Software Development
> 
> Basler Vision Technologies
> An der Strusbek 60-62
> 22926 Ahrensburg
> Germany
> 
> Tel +49 (4102) 463-162
> Fax +49 (4102) 463-239
> 
> mailto:thomas.koeller@baslerweb.com
> http://www.baslerweb.com
> 
> ==============================
> 
> 
> -- 
> Before posting, please read the FAQ: 
> http://sources.redhat.com/fom/ecos
> and search the list archive: http://sources.redhat.com/ml/ecos-discuss
> 

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

^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: [ECOS] Stress testing JFFS2
@ 2003-10-15 11:53 Dinesh Kumar
  2003-10-15 12:54 ` Thomas Koeller
  0 siblings, 1 reply; 22+ messages in thread
From: Dinesh Kumar @ 2003-10-15 11:53 UTC (permalink / raw)
  To: ecos-discuss; +Cc: linux-mtd

> Every operation that changes the contents of the
FLASH 
> (even deleting files!)is performed by writing new 
> nodes to the FLASH. Every such node is represented
in 
> RAM by a struct jffs2_raw_node_ref. The memory 
> occupied by these structs is never freed unless the 
> file system is unmounted or garbage collection takes

> place.
I am newbie to JFFS2. What is the reason behind not
freeing jffs2_raw_node_ref from RAM (even after they
have been used)?

Regards
Dinesh

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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

^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: [ECOS] Stress testing JFFS2
@ 2003-10-08  7:37 Øyvind Harboe
  2003-10-08  9:07 ` Jani Monoses
  0 siblings, 1 reply; 22+ messages in thread
From: Øyvind Harboe @ 2003-10-08  7:37 UTC (permalink / raw)
  To: ecos-discuss, thomas.koeller

>What I found out so far is that the memory does not seem to be lost
>permanently, if the file system is unmounted, it's all there again. I'd
> be delighted if someone came up with a solution!

Daved Woodhouse seems to be referring to this problem in this
thread:

http://lists.infradead.org/pipermail/linux-mtd/2003-August/008363.html

Øyvind



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

^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: [ECOS] Stress testing JFFS2
@ 2003-10-07 16:43 Øyvind Harboe
  0 siblings, 0 replies; 22+ messages in thread
From: Øyvind Harboe @ 2003-10-07 16:43 UTC (permalink / raw)
  To: ecos-discuss; +Cc: dvrabel

>Also, in a previous message you mentioned setting the number of
>required free blocks to zero.  Was this done in this test?  

No.

>If so then
>(as I >understand it) JFFS2 will not work as there are no free blocks
>for GCing so old nodes cannot be deleted thus you have no free flash
>left.

Actually, when I set required number of free blocks to zero,
my test case does a 100k iterations without problems.

Occasionally I see a short pause when presumably it does garbage
collection.

For me setting required number of free blocks to zero has
been a cureall.

Øyvind



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

^ permalink raw reply	[flat|nested] 22+ messages in thread
* [ECOS] Stress testing JFFS2
@ 2003-10-07 10:57 Øyvind Harboe
  2003-10-07 12:31 ` David Vrabel
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Øyvind Harboe @ 2003-10-07 10:57 UTC (permalink / raw)
  To: ecos-discuss

Today stress testing JFFS2 came up on the agenda, and I wrote a small
piece that demonstrates a problem with JFFS2 running out of space
when it shouldn't, leaving a corrupt JFFS2 image and continuously
allocating more ram.

The test consists of writing lots of files that overwrite existing
files. The total number of files is never >16.

/config is a JFFS2 fs. 6*0x10000bytes.

Should I expect this sort of thing to never fail and to
reach a plateau of memory usage?

20-30k ram seems excessive for 16 files.

    char *args="dummy";    
    for (int i=0; i<10000; i++)
    {
    	char name[5];
    	for (int j=0; j<(sizeof(name)-1); j++)
    	{
	    	name[j]=rand()%2+'a';
    	};
    	name[4]=0;
    	
		char nameBuffer[100];
		sprintf(nameBuffer, "/config/%s", name);

		int fd;
	    fd = open( nameBuffer, O_WRONLY|O_CREAT|O_TRUNC );
	    if (fd<0)
	    {
			diag_printf("Failed\r\n");
			break;
	    }
    
		int len=strlen(args);    
		ssize_t actual;
		actual=write(fd, args, len);
		if (actual<0)
		{
			diag_printf("Failed\r\n");
			break;
		}
		int err;
		err=close(fd);
		if (err<0)
		{
			diag_printf("Failed\r\n");
			break;
		}
		
		struct mallinfo info;
		info = mallinfo();
		
    	if ((i%100)==0)
    	{
	    	diag_printf("Created file %d  %d bytes ram free\r\n", i,
info.maxfree);
    	}
    }
    

Output:


Created file 0  153284 bytes ram free
Created file 100  149132 bytes ram free
Created file 200  146732 bytes ram free
Created file 300  144332 bytes ram free
Created file 400  141932 bytes ram free
Created file 500  139532 bytes ram free
Created file 600  137132 bytes ram free
Created file 700  134732 bytes ram free
Created file 800  132332 bytes ram free
Failed



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

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2003-10-16 10:25 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-16  7:23 [ECOS] Stress testing JFFS2 Øyvind Harboe
2003-10-16  7:32 ` Andrew Lunn
2003-10-16  7:35   ` Øyvind Harboe
  -- strict thread matches above, loose matches on Subject: below --
2003-10-15 18:33 Doug Fraser
2003-10-15 11:53 Dinesh Kumar
2003-10-15 12:54 ` Thomas Koeller
2003-10-08  7:37 Øyvind Harboe
2003-10-08  9:07 ` Jani Monoses
2003-10-15 10:07   ` Thomas Koeller
2003-10-15 10:52     ` David Woodhouse
2003-10-15 11:26       ` Thomas Koeller
2003-10-16 10:25         ` David Woodhouse
2003-10-07 16:43 Øyvind Harboe
2003-10-07 10:57 Øyvind Harboe
2003-10-07 12:31 ` David Vrabel
2003-10-07 13:04 ` Andrew Lunn
2003-10-07 13:16   ` Øyvind Harboe
2003-10-07 13:43     ` Andrew Lunn
2003-10-07 16:42       ` Thomas Koeller
2003-10-07 17:57         ` Andrew Lunn
2003-10-08  8:34           ` Thomas Koeller
2003-10-07 13:36 ` Eric Donnat

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).