[Yaffs] heavy file usage in yaffs

Jacob Dall jacob.dall@operamail.com
Mon, 17 Jan 2005 16:00:48 +0100


Hello Charles,

All file names are on a 8.3 format, and NO, I'm not using SHORT_NAMES_IN_RA=
M.

I've just recompiled my project defining CONFIG_YAFFS_SHORT_NAMES_IN_RAM, b=
ut unfortunately I notice no change in time used to perform the dumpDir().

The files I'm listing, was written before I defined short names in RAM. In =
this case, should one expect the operation to take less time?

The CPU I'm running this test on, is comparable to a Pentium I-200MHz.=20

The body of dumpDir() looks like this:
<code>
  d =3D yaffs_opendir(dname);
  if (d) {
    while((de =3D yaffs_readdir(d)) !=3D NULL) {
      if (total > lastTotal + 100 * 9 * 1024) {
        printf("total =3D %d\n", total);
        lastTotal =3D total;
      }
      sprintf(str,"%s/%s",dname,de->d_name);
      yaffs_lstat(str,&s);
			switch(s.st_mode & S_IFMT){
			case S_IFREG:
        //printf("data file");
        total +=3D s.st_size;
        break;
      }
    }

    yaffs_closedir(d);
  }
</code>

Below I've listed some rough timing for the included steps in my test - tim=
es shown is time used for the indicated step:

yaffs_StartUp - 1.4 sec
yaffs_mount - 6.7 secs (the partition I'm mounting is 30MB)
the 1. printf("total... - 1.6 sec
2. printf - 1.9
The following printf's shows after 2.1, 2.7, 5.0, 7.0, 9.0, 11.6, 14.2, 17.=
5, 21.2

At this point, I've been through 1/3 of the files - finishing up takes 10+ =
minutes.
Each file is approx. 9KB in size.

Is an increase in time consumed by each step expectable?

Is there any other (faster) way I can get hold of the file names?

Thank you for replying. I really appreciate it.

Best Regards,
Jacob



----- Original Message -----
From: "Charles Manning" <Charles.Manning@trimble.co.nz>
To: "Jacob Dall" <jacob.dall@operamail.com>, yaffs@stoneboat.aleph1.co.uk
Subject: RE: [Yaffs] heavy file usage in yaffs
Date: Mon, 17 Jan 2005 09:25:22 +1300

>=20
>=20
> > Hello yaffers,
> >
> > I'm testing yaffs1/direct in a system with a rather high file=20
> > write / erase rate, i.e 1 file / sek with size ranging from 5 to=20
> > 20KB
> >
> > Is that something possible with yaffs1?
>=20
> Most definitely OK. Performance numbers depend on the hardware you're
> using, but with NAND on a reasonable interface, you should be able to
> get at least 200 to 300 kbytes/sec even under heavy garbage collection.
>=20
> >
> > Upon boot I want to make an index table holding the names of the=20
> > files stored in flash. What's the best way to achieve this, when=20
> > the indexing has to be swift (10 - 20 secs) - using yaffs_opendir=20
> > / yaffs_readdir seems to take a huge amount of time (10+ mins)=20
> > when many files (2000-3000) are present?
>=20
> I'm quite surprised that it is taking so long to do this operation.
>=20
> One of the optimisations in YAFFS is to store short names in RAM. Do you
> have this enabled? How long are the names?
> -- Charles
>=20
> _______________________________________________
> yaffs mailing list
> yaffs@stoneboat.aleph1.co.uk
> http://stoneboat.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs