On Sat, 18 Mar 2000, Jeff Garzik wrote:
> The attached patch agsinst 2.3.99-pre1-pre4 (ok for pre5 too) fixes
> drivers/net/net_init.c to correctly alignment dev->priv on a 32-byte
> (not bit) boundary. Stupid thinko of mine aligned the size not the ptr
> ;-)
>
> This should save code and allocations in drivers, as is evidenced by the
> attached patch against via-rhine.c utilizing the alignment change.
The re-alignment code exists because of a similar stupid "thinko" in a few
other kernel versions, where the allocation code changed to misalign the
returned area.
Removing the code prevents backward compatibility, and risks a similar
change in the future either breaking drivers, or perhap worse, silently
having a very bad performance impact that is difficult to trace to the
source.
The bad performance comes when a chip has to do three or more PCI
transactions instead of one to transfer data. An over-by-one alignment can
cause more than one extra transactions, since many chips recover from
misalignment by ramping up transfer lengths by powers of two until they are
back on a cache line boundary. (You might claim the hardware should be
smarter, but it's the software people that shouldn't make the mistake.)
You should understand why the code exists before changing it.
Donald Becker
Scyld Computing Corporation, [EMAIL PROTECTED]
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]