[Patch] fix MTD CFI/LPDDR flash driver huge latency bug

Jamie Lokier jamie at shareable.org
Fri Mar 19 04:40:48 EDT 2010


David Woodhouse wrote:
> Rather than pulling a number our of our posterior like "every 256 bytes"
> which might _really_ screw up performance of some architectures' memcpy
> routines, I suspect we might want the platform to provide an optimised
> "sleepable_memcpy" function which does it at whatever interval is
> appropriate for the memcpy routine in use. Or magically makes it
> preemptable. Or uses a DMA engine. Or whatever.
>
> I wonder where else we could use such a function...

The posterior number isn't great, although I don't see how it would
really harm memcpy performance to check current->need_resched even
quite often.

In this instance, the speed depends on the flash which can be as much
as 100x slower than RAM - that's the particular situation where it
might be most useful to split the copies.

Other uses of sleepable_memcpy you may be thinking of could be
operating on RAM only, so the number should be 100x larger for them.

In other words, "whatever interval is appropriate for memcpy" does not
exist, and could not be hard-coded into sleepable_memcpy.  It's
whatever interval is appropriate for the particular memory being
copied, so it would have to be a parameter.

-- Jamie



More information about the linux-mtd mailing list