2009-09-02 00:20:31     Poor NAND flash write performance

Document created by Aaronwu Employee on Aug 19, 2013
Version 1Show Document
  • View in full screen mode

2009-09-02 00:20:31     Poor NAND flash write performance

Jay Ku (UNITED STATES)

Message: 79460   

 

I'm using a 4Gbit NAND flash (NAND04...) on a BF532 custom board with 2.6.22.19-ADI-2008R1.5-svn.  I'm only getting about 100Kbytes/sec when writing to the flash (mounted with yaffs2), while reading from it I get at least 100x that (I'm testing by copying a 1MB file between the NAND flash and the RAM disk).  Based on the spec sheet for the NAND04, the performance should be much better than this.  I found some posts that referenced an earier thread about this type of problem, but I can't find the original thread.  Can anyone point me to some advice on this problem?

 

 

 

Thanks,

 

Jay

QuoteReplyEditDelete

 

 

2009-09-02 00:31:00     Re: Poor NAND flash write performance

Yi Li (CHINA)

Message: 79462   

 

Could you use bonnie++ to test? See   docs.blackfin.uclinux.org/doku.php?id=linux-kernel:mtd

 

 

 

e.g,

 

root:/> flash_eraseall /dev/mtd4                                

root:/> mount -t yaffs2 /dev/mtdblock4 /mnt/                                           

root:/> bonnie++ -u root -d /mnt -s 200M

 

QuoteReplyEditDelete

 

 

2009-09-02 02:51:34     Re: Poor NAND flash write performance

Jay Ku (UNITED STATES)

Message: 79476   

 

Yi,

 

I'm using the 2008R1.5 distribution and I'm having trouble locating bonnie++ in there; do you know if it was included with that disty?

 

- Jay

QuoteReplyEditDelete

 

 

2009-09-03 02:44:14     Re: Poor NAND flash write performance

Jay Ku (UNITED STATES)

Message: 79508   

 

Yi,

 

Not sure I can easily get bonnie++ running on my disty.  Assuming 'cp' is using block transfers and I'm still getting this type of poor performance, do you have any idea why my flash write speed is so slow?

 

Thanks,

 

Jay

QuoteReplyEditDelete

 

 

2009-09-03 03:28:25     Re: Poor NAND flash write performance

Yi Li (CHINA)

Message: 79511   

 

Jay,

 

Is it possible for you to move to 2009R1? (2008R1.5 does not include bonnie++, but you can build it in 2008R1.5). I suggest to use bonnie++ to measure I/O performance, because simple cp/dd may be affected by pagecache - so the performance result may vary from time to time.

 

How about the result like this:

 

time dd conv=fsync if=/dev/zero of=/mnt/100m.bin bs=1M count=100

 

100KB write speed for Nand flash seems abnormal. You may have to dig into the Nand driver to find the cause.

 

-Yi

QuoteReplyEditDelete

 

 

2009-09-03 04:35:26     Re: Poor NAND flash write performance

Jay Ku (UNITED STATES)

Message: 79514   

 

Yi,

 

Turns out the problem was my stupid mistake.  When I ported the platform nand driver to my board, I made an error in bfin_plat_nand_dev_ready() which was causing it to always return 0 (not ready).  I guess the driver was timing out eventually, but this made the writes look really slow.  Now things are MUCH better:

 

root:/mnt> time dd if=/dev/zero of=/mnt/dd1.bin bs=10K count=3000

3000+0 records in

3000+0 records out

real    0m 14.29s

user    0m 0.01s

sys     0m 13.58s

root:/mnt> time dd if=/dev/zero of=/mnt/dd2.bin bs=100K count=300

300+0 records in

300+0 records out

real    0m 11.64s

user    0m 0.00s

sys     0m 10.54s

root:/mnt> time dd if=/dev/zero of=/mnt/dd3.bin bs=1000K count=30

30+0 records in

30+0 records out

real    0m 11.70s

user    0m 0.00s

sys     0m 10.50s

root:/mnt>

 

This works out to somewhere between 2-3Mbytes/sec, which seems reasonable.  Also my mount time is dramatically faster now (before it took ~30s).

 

 

 

Thanks,

 

Jay

 

 

 

PS: I'll probably switch to the new 2009 release soon.  Do you know if it will work with U-Boot 2009.03 (ADI-2009R2-pre)?

QuoteReplyEditDelete

 

 

2009-09-03 05:03:51     Re: Poor NAND flash write performance

Yi Li (CHINA)

Message: 79517   

 

> "PS: I'll probably switch to the new 2009 release soon.  Do you know if it will work with U-Boot 2009.03 (ADI-2009R2-pre)?"

 

You may Use uboot 2009R1. Why do you want to use 2009.03?

QuoteReplyEditDelete

 

 

2009-09-03 05:12:50     Re: Poor NAND flash write performance

Jay Ku (UNITED STATES)

Message: 79518   

 

> "PS: I'll probably switch to the new 2009 release soon.  Do you know if it will work with U-Boot 2009.03 (ADI-2009R2-pre)?"

 

You may Use uboot 2009R1. Why do you want to use 2009.03?

 

---

 

I'm using 2009.03 now.  Took me while to get it working and it seems stable now, so I'd rather not change to something new if I don't have to.

QuoteReplyEditDelete

 

 

2009-09-03 11:07:30     Re: Poor NAND flash write performance

Mike Frysinger (UNITED STATES)

Message: 79569   

 

off the top of my head, there's no real reason why u-boot-2008.10+ wouldnt work exactly the same, but we dont test it and wont make any promises

Attachments

    Outcomes