On Thu, Nov 20 2003, Kai Makisara wrote: > On Wed, 19 Nov 2003, Jens Axboe wrote: > > > On Wed, Nov 19 2003, Kai Makisara wrote: > .. > > > As usual, I am against this 512-byte alignment (thinking as st > > > maintainer). Don't default to more strict aligment requirements than is > > > necessary. It creates hidden performance problems for character device > > > drivers. > > > > But you have to honor hardware restrictions, though. Where is the > > performance impact? > > > Yes, I agree that we must not try to do things the hardware does not > allow. On i386, most SCSI adapter accept any alignment. It is a waste to > require 512-byte alignment with these adapters just because USB requires > that. I think there should be a way for the high-level drivers to know > about the absolutely necessary alignment requirements for the actual > adapter being used with a device. > > If the user buffer is not aligned according to the required rules, the > driver must copy the data into a temporary buffer for i/o. This consumes > bandwidth and with the current faster tape drives this leads to > significant waste of cpu cycles (according to measurements). > > The software using tapes tends to malloc() the buffers and then the > alignment is not guaranteed to 512 byte boundaries. Other Unices don't > have alignment requirements for tape buffers and I think we should avoid > requiring this in Linux if possible.
Then you just cannot do zero-copy dma, if the buffer isn't aligned properly. It's as simple as that. And surely that wont kill you performance wise. Doing bounce buffering to just maintain the use of mapping user pages into the kernel ls out right silly. So no, I still don't think we have to add anything. Just don't do_dio if the alignment doesn't allow it. Ditto for sg. -- Jens Axboe ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
