public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* Many small files instead of one large files - writing, wearing, mount-time?
@ 2005-03-08  8:59 Martin Egholm Nielsen
  2005-03-09 10:58 ` Artem B. Bityuckiy
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Egholm Nielsen @ 2005-03-08  8:59 UTC (permalink / raw)
  To: linux-mtd

Hi there,

I'm about to make a choice of design. I have many many (i.e. O(3) - 
[0-9]*1000) "resources" in an application that need their states flushed 
to NAND-JFFS2 whenever they change - which happens with very different 
frequencies for different resources.

Hence, me initial strategy was to have a file in NAND for each resource. 
However, I noticed that mount-time increased "severely" when many files 
were put on the device, and doing an "ls" first time on the 
device/directory took lots of time as well.

Unfortunately low mount-time is one of the factors giving the user a 
good experience with the system, so I started considering another 
strategy - namely one large file to hold all these states.

However, I'm a bit concerned how fopen( ..., "rw" ) is handled 
underneith when I flush/sync the filedescriptor if I only mess with a 
small part of the file. Is the entire file flushed to NAND once more, or 
does Linux+JFFS2 handle this, and only write the parts (inodes) that are 
affected...

BR,
  Martin

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

* Re: Many small files instead of one large files - writing, wearing, mount-time?
  2005-03-08  8:59 Many small files instead of one large files - writing, wearing, mount-time? Martin Egholm Nielsen
@ 2005-03-09 10:58 ` Artem B. Bityuckiy
  2005-03-09 11:11   ` Martin Egholm Nielsen
  0 siblings, 1 reply; 3+ messages in thread
From: Artem B. Bityuckiy @ 2005-03-09 10:58 UTC (permalink / raw)
  To: linux-mtd; +Cc: martin

On Tue, 2005-03-08 at 09:59 +0100, Martin Egholm Nielsen wrote:
> Hi there,
Hello

> Hence, me initial strategy was to have a file in NAND for each resource. 
> However, I noticed that mount-time increased "severely" when many files 
> were put on the device, and doing an "ls" first time on the 
> device/directory took lots of time as well.
Owing to its design JFFS2 works extremely slowly wit directories
containing so many files.

> Unfortunately low mount-time is one of the factors giving the user a 
> good experience with the system, so I started considering another 
> strategy - namely one large file to hold all these states.
> 
> However, I'm a bit concerned how fopen( ..., "rw" ) is handled 
> underneith when I flush/sync the filedescriptor if I only mess with a 
> small part of the file. Is the entire file flushed to NAND once more, or 
> does Linux+JFFS2 handle this, and only write the parts (inodes) that are 
> affected...
Don't worry, Only that "messed" peace will be flushed. The "large file"
solution will be definitely faster.

-- 
Best Regards,
Artem B. Bityuckiy,
St.-Petersburg, Russia.

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

* Re: Many small files instead of one large files - writing, wearing, mount-time?
  2005-03-09 10:58 ` Artem B. Bityuckiy
@ 2005-03-09 11:11   ` Martin Egholm Nielsen
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Egholm Nielsen @ 2005-03-09 11:11 UTC (permalink / raw)
  To: linux-mtd

>>Hence, me initial strategy was to have a file in NAND for each resource. 
>>However, I noticed that mount-time increased "severely" when many files 
>>were put on the device, and doing an "ls" first time on the 
>>device/directory took lots of time as well.
> Owing to its design JFFS2 works extremely slowly wit directories
> containing so many files.
 From IRC - just to keep the ML thread up to date:

egholm:   But could I make it faster by putting them into sub-directories?

dedekind: you could if the number of your subdirectories is small

dedekind: besically, JFFS2 uses the list to keep all the directory's 
children

dedekind: so, the performance is linear dependend on the number of children

egholm:   number of childrens - in one layer only? or accumulated children?

dedekind: in one layer

egholm:   super! Then that may be a solution! Thanx

// Martin

>>Unfortunately low mount-time is one of the factors giving the user a 
>>good experience with the system, so I started considering another 
>>strategy - namely one large file to hold all these states.
>>
>>However, I'm a bit concerned how fopen( ..., "rw" ) is handled 
>>underneith when I flush/sync the filedescriptor if I only mess with a 
>>small part of the file. Is the entire file flushed to NAND once more, or 
>>does Linux+JFFS2 handle this, and only write the parts (inodes) that are 
>>affected...
> 
> Don't worry, Only that "messed" peace will be flushed. The "large file"
> solution will be definitely faster.
> 

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

end of thread, other threads:[~2005-03-09 11:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-08  8:59 Many small files instead of one large files - writing, wearing, mount-time? Martin Egholm Nielsen
2005-03-09 10:58 ` Artem B. Bityuckiy
2005-03-09 11:11   ` Martin Egholm Nielsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox