Longs spinlock on NOR reads

Bill Gatliff bgat at billgatliff.com
Thu Jun 25 19:20:49 EDT 2009


Roger Lucas wrote:
> Before going through the process of submitting patches etc., is this a 
> problem that has been identified or experienced before?  I have searched the
> mailing list but not seen any obvious references...
>   

I haven't seen the problem you are describing, but I haven't studied the
performance of JFFS2 down at those time levels.  Your problem
description sounds very reasonable, however, as does the proposed fix.

I think you'll probably get down to 7ms only if the compiler is doing a
lot of ldm/stm, which I'd be surprised to see.  But the overhead of a
function call for every 512 bytes might be measurable--- is there a
point within the lowest-level code that might be a good place to briefly
unlock and then re-lock the spinlock?  That would reduce the overhead of
the fix by avoiding the function call.

Regardless, if someone is paying attention to the numbers then they're
probably more concerned with the latency than throughput.  In that case,
if the only way to substantially improve latency is to take a
per-512-byte function call hit then I (for one) can live with that.

> If it seems a reasonable observation and fix, would you like me to post a 
> patch?  I can only patch and test the 'cfi_cmdset_0002.c' driver but it 
> would be a simple process for it to be applied to the other chips.
>   

Definitely post the patch.  Can't reject something we haven't seen.  :)

Maybe it needs to be surrounded by a CONFIG_MTD_<something> so that
people can turn it on or off via menuconfig.


b.g.



More information about the linux-mtd mailing list