• Status Closed
  • Percent Complete
  • Task Type Patches
  • Category Drivers
  • Assigned To No-one
  • Operating System All players
  • Severity Low
  • Priority Very Low
  • Reported Version Daily build (which?)
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by pamaury - 2010-02-09
Last edited by pamaury - 2010-02-14

FS#10991 - Rewrite dircache generation to free ram and stack

This patch is a complete rewrite of dircache generation using some subtle properties of the FAT code. It currently doesn't contain code for the simulator ! It allows to free 30kib of ram and have a 600 bytes binsize reduction.

If you can test it, I'm particulary interested in:
* correctness: do you notice any problem ?
* stack usage: report dircache thread usage if you can

TODO: the current code doesn't add the "." and ".." entries in dircache for now. I don't know if it can cause problems.

Closed by  pamaury
2010-02-14 23:06
Reason for closing:  Accepted
Additional comments about closing:   Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407


New version adding the "." and "..". I've noticed that putting the fat_ structures on the stack at the beginning leads to a big stack usage in the dircache thread. This could lead to a stokv on a very deep directory structure and I'm not sure at which depth.

The binsize reduction is of 200bytes with this version.

I've put this on my mini2g and I'll let you know any wierdness that shows up

no issus so far. Is there anything which especially shold be tested? Also it doesnt build for the sim.

It's normal that it doesn't build for the sim (I've not written the code !). You can check not so usual operations such as rename, delete, … But if everything seems to work, then there shouldn't be any bug because it's really on the generation which changed.

I've not been able to test this yet as I currenlty only have a sim, no device - but I'd hope that the sim shouldn't need any special code/#ifdefs at the dircache level. Ideally, any differences should be abstracted at the file system (FAT) level….

I disagree, the simulator doesn't use the FAT code in any way (for now) so it makes sense to use a specialized version for the simulator in dircache.
This makes sense because the version I propose bypass the "normal" I/O api to use the FAT code which is an optimization only valid on a real target.
I'll try to upload an up to date version for the simulator quickly.

New version:
-minor code change in dircache generation
-now there is code for the simulator

Tested on Gigabeat S:
All is working well here, no noticeable changes.


Available keyboard shortcuts


Task Details

Task Editing