NS83820 2.6.0-test5 driver seems unstable on IA64
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 9 lines · David S. Miller
Quoted 5 lines · On Fri, 26 Sep 2003 10:47:12 -0700 David Mosberger <[email protected]>…
Arches that don't like/support unaligned accesses will certainly have a
copy_user()which handles misalignment just fine. For example, on ia64, the copy will run slightly slower because of an additional shift in the loop, but that penalty only shows on fully cached data.
Quoted 3 lines
Exactly correct, and on many platforms (sparc64 happens to be one) there is _ZERO_ performance penalty for misalignment or source or destination buffer during a memcpy/memmove.
You handle misalignment->misalignment copies with zero or small cost - when both source and destination have the same misalignment. I guess you do that by just aligning the pointer at the beginning of the function. That works as long as both source and destination have the same misalignment.
But that is not what happens here. The copy is a misaligned->aligned copy and that cannot be handled at zero cost (unless you have zero misalignment penalty in load/store). Either the load or the store in the copy loop will be always misaligned, no matter what tricks you play. You cannot avoid this by aligning the pointers.
The user buffers tend to be aligned, so when the kernel data is misaligned the copy ends up requiring an misaligned load in the inner copy loop.
Of course you could try to teach the user to use intentionally misaligned buffers in his programs to avoid this, but it would be likely a hard sell and be a bad idea on less crippled NICs.
The copy inside the device driver has the same problem: misaligned data -> aligned skb => the load in the copy will be misaligned, the store aligned. You avoid a few unaligned loads in the core stack, at the cost of hundreds in the copy. Seems like a bad trade-off to me.
-Andi
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Andi Kleen
Andi> You handle misalignment->misalignment copies with zero or Andi> small cost - when both source and destination have the same Andi> misalignment. I guess you do that by just aligning the pointer Andi> at the beginning of the function. That works as long as both Andi> source and destination have the same misalignment.
Andi> But that is not what happens here. The copy is a Andi> misaligned->aligned copy and that cannot be handled at zero Andi> cost (unless you have zero misalignment penalty in Andi> load/store). Either the load or the store in the copy loop Andi> will be always misaligned, no matter what tricks you play. You Andi> cannot avoid this by aligning the pointers.
Geez, Andi, get a clue. You've been working with x86 for too long.
You really can't imagine that you could combine two source words into a single destination word? Look ma, no unaligned accesses...
--david
Quoted 5 lines · On Sat, 27 Sep 2003 06:26:40 +0200 Andi Kleen <[email protected]> wrote:
You handle
misalignment->misalignmentcopies with zero or small cost - when both source and destination have the same misalignment. I guess you do that by just aligning the pointer at the beginning of the function. That works as long as both source and destination have the same misalignment.
Nope, different alignments are fully optimized as well.
Sparc64 VIS has special instructions so that you can handle all of these different src/dst alignment cases and still use the 64-byte-at-a-time cache bypassing loads and stores.