UBI fastmap used PEB search

Brian Pomerantz bapper at gmail.com
Wed May 1 13:14:02 EDT 2013


I have been doing some profiling on why it takes UBI attach longer as UBI volumes fill up.  I found that the majority of time takes place in fastmap.c during the search of the used PEB list when matching for the volume's LEBs.  Specifically, I saw that the inner loop "list_for_each_entry(tmp_aeb, &used, u.list)" gets hit a LOT.  The time it takes to search this list can be reduced if the attached patch is used, all it does is put a break in the loop when the pnum is matched.  This seems so obvious I figure there must be a reason it isn't done this way, is the patch valid or will it cause issues?  I'm also wondering if anyone has tried building the used list as a RB tree instead to further reduce the time spent spinning through the list.


Brian

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fastmap-pnum-break.patch
Type: application/octet-stream
Size: 478 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20130501/7a2f45ba/attachment.obj>


More information about the linux-mtd mailing list