Re: [PATCH 2.4] jffs2 aligment problems

From: Linus Torvalds
Date: Mon Jun 07 2004 - 15:56:01 EST




On Mon, 7 Jun 2004, David Woodhouse wrote:
>
> On Mon, 2004-06-07 at 12:22 -0700, Linus Torvalds wrote:
> > I don't see it as a correctness issue, I see it as a performance issue.
>
> In the case in question it's very much _not_ a performance issue. We're
> writing a buffer to FLASH memory. The time it takes to read the word
> from RAM is entirely lost in the noise compared with the time it takes
> to write it to the flash.

Not if you have to take an alignment fault, which is easily several
thousand cycles.

Think of "get_unaligned()" as a worst-case limiter. It can make the best
case be worse on architectures where it matters, but it can make the worst
case go from thousands of cycles to just single cycles.

And your flash isn't _that_ slow. Thousands of cycles that can't even
overlap with any flash IO _does_ show up.

Now, whether the unaligned case is common enough for people to even worry,
I don't know.

Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/