Long attach times attaching MTD to UBI

David Lambert dave at lambsys.com
Mon Sep 28 15:52:08 EDT 2009


Please excuse me if this is a naive question as I am a newbie to MTD and 
flash file systems.

I am attempting to enable UBIFS on an Atmel AT91RM9200 using kernel 
version 2.6.30.1. One of the attractions was fast mount times compared 
to JFFS2 etc. Unfortunately I am running into VERY long attach times as 
witnessed below. Obviously I must be doing something very wrong as the 
documentation indicates that attaching a 1G partition should take around 
2 seconds, but mine is over 8 minutes!


Any help in how I can identify the bottleneck would be greatly appreciated.



# time ubiattach /tmp/ubi_ctrl -m 6
UBI: attaching mtd6 to ubi2
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    129024 bytes
UBI: smallest flash I/O unit:    2048
UBI: sub-page size:              512
UBI: VID header offset:          512 (aligned 512)
UBI: data offset:                2048
UBI: attached mtd6 to ubi2
UBI: MTD device name:            "NAND3"
UBI: MTD device size:            1200 MiB
UBI: number of good PEBs:        9573
UBI: number of bad PEBs:         27
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     0
UBI: available PEBs:             9474
UBI: total number of reserved PEBs: 99
UBI: number of PEBs reserved for bad PEB handling: 95
UBI: max/mean erase counter: 1/1
UBI: background thread "ubi_bgt2d" started, PID 425
UBI device number 2, total 9573 LEBs (1235146752 bytes, 1.2 GiB), 
available 9474 LEBs (1222373376 bytes, 1.1 GiB), LEB size 129024 bytes 
(126.0 KiB)

real    8m3.943s
user    0m0.010s
sys     7m53.621s
#

Formatting the same partition takes around 1.5 minutes

# time ubiformat /dev/mtd6
ubiformat: mtd6 (nand), size 1258291200 bytes (1.2 GiB), 9600 
eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
libscan: scanning eraseblock 9599 -- 100 % complete 
ubiformat: 9573 eraseblocks have valid erase counter, mean value is 1
ubiformat: 27 bad eraseblocks found, numbers: 70, 164, 533, 885, 2477, 
2807, 3096, 3777, 3972, 4023, 4390, 4506, 4836, 5115, 5245, 5282, 5284, 
5528, 5614, 5720, 5860, 6332, 6616, 7223, 7864, 7948, 8841
ubiformat: formatting eraseblock 9599 -- 100 % complete 

real    1m33.187s
user    0m5.545s
sys     0m33.862s
#





More information about the linux-mtd mailing list