Re: memcpy_toio on i386 using byte writes even when n%2==0

From: H. Peter Anvin
Date: Mon May 29 2006 - 03:38:11 EST


Followup to: <44779358.9010703@xxxxxxx>
By author: Robert Hancock <hancockr@xxxxxxx>
In newsgroup: linux.dev.kernel
>
> It does seem a little bit less efficient, but I don't know think it's
> necessarily a bug. There's no guarantee of what size writes will be used
> with the memcpy_to/fromio functions.
>

There are only a few semantics that make sense: fixed 8, 16, 32, or 64
bits, plus "optimal"; the latter to be used for anything that doesn't
require a specific transfer size. Logically, an unqualified
"memcpy_to/fromio" should be the optimal size (as few transfers as
possible) -- we have a qualified "memcpy_to/fromio32" already, and 8-
and 16-bit variants could/should be added.

However, having the unqualified version do byte transfers seems like a
really bad idea.

-hpa

-
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/