Re: [patch-2.4.0-test2]Re: Linux-2.4.0-test2

From: Andi Kleen (ak@suse.de)
Date: Sun Jun 25 2000 - 09:24:54 EST


On Sun, Jun 25, 2000 at 12:47:20PM +0100, Alan Cox wrote:
> > architectures as well; the difference are that:
> > - kernels are quiet about that save Alpha
> > - on x86 these misaligned accesses are not that costly but elsewhere
> > they can be quite a drag.
>
> In the networking code we intentionally take them. Its faster to try to align
> (with 99.9something% success) than to always assume the worst. That is quite
> common in the kernel - it pays to assume the common good case and only pay
> for the rare cases it fails. copy_*_user has the same attitude

Except when you cannot align (like with Tulips that always DMA to a 4 byte
aligned address). With the 14 byte Ethernet header this results in IP
and TCP misaligned.

On x86 which has reasonably fast misalignment handling that is tolerable,
but on Alpha etc. it is cheaper to copy the whole packet than to hit
the many misalignment exceptions during packet processing.

For this case it would be far cheaper to only copy and align the header
(handling misalignment in data copy and checksumming is cheap), but
that is not possible ATM.

-Andi

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



This archive was generated by hypermail 2b29 : Mon Jun 26 2000 - 21:00:07 EST