Re: [BUG] slab debug vs. L1 alignement

From: Benjamin Herrenschmidt (benh_at_kernel.crashing.org)
Date: 08/16/03

  • Next message: Christoph Hellwig: "[PATCH] mark devfs obsolete"
    To: Kai Makisara <Kai.Makisara@kolumbus.fi>
    Date:	16 Aug 2003 13:36:30 +0200
    
    

    > ->
    > A character device (like st) doing direct i/o from user buffer to/from a
    > SCSI device does not currently have any alignment restrictions. I think
    > restricted alignment can't be required from a user of an ordinary
    > character device. This must then be handled by the driver. The solution is
    > to use bounce buffers in the driver if the alignment does not meet the
    > lower level requirements. This leads to surprises with performance if the
    > user buffer alignment does not satisfy the requirements (e.g., malloc()
    > may or may not return properly aligned blocks). These surprises should be
    > avoided as far as the hardware allows.

    THe low level driver can't do the bounce buffer thing, it has to be
    done at higher layers.

    > If an architecture has restrictions, they must, of course, be taken into
    > account. However, this should not punish architectures that don't have the
    > restrictions. Specifying that DMA buffers must be cache-line aligned would
    > be too strict. A separate alignment constraint for DMA in general and for
    > a device in specific would be a better alternative (a device may have
    > tighter restrictions than an architecture). The same applies to buffer
    > sizes. This would mean adding two more masks for each device (like the
    > current DMA address mask for a device).

    That won't help for buffers coming from higher layers that don't know
    the device they'll end up to

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


  • Next message: Christoph Hellwig: "[PATCH] mark devfs obsolete"

    Relevant Pages

    • Re: Alignment of disk-I/O from userland.
      ... SL>>>alignment of data buffers used to access disk devices directly. ... SL>Working around hardware requirements from the block layer gets messy. ... SL>communicate this property upwards from the driver? ...
      (freebsd-arch)
    • Re: [BUG] slab debug vs. L1 alignement
      ... >> With slab debugging on, ... > beeing passed aligned buffers, if somebody don't agree, please speak ... SCSI device does not currently have any alignment restrictions. ... Specifying that DMA buffers must be cache-line aligned would ...
      (Linux-Kernel)
    • Re: Alignment of disk-I/O from userland.
      ... >>alignment of data buffers used to access disk devices directly. ... Working around hardware requirements from the block layer gets messy. ... You obviously don't want to manually align buffers that are distined ... People expect their hardware to Just Work, regardless of how cheap ...
      (freebsd-arch)
    • Re: DeviceIoControl failed in WOW64 on 64bit XP Pro
      ... >> Alignment can be an issue. ... Align all IOCTL buffers on 8 bytes. ... I understand that you are not passing any pointers... ... 64-bit alignment of IRP buffers before they check anything else. ...
      (microsoft.public.development.device.drivers)
    • Re: CFT: vr(4)
      ... I've ported your driver to DragonFlyBSD and am running it on a PC Engines ALIX1.C ... vr0: Revision: 0x96 ... One of the problems that I ran into with this new driver was Tx/Rx buffer alignment. ...
      (freebsd-current)