lkml.org 
[lkml]   [2018]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: block: DMA alignment of IO buffer allocated from slab
    On Fri, 21 Sep 2018, Christoph Hellwig wrote:

    > On Fri, Sep 21, 2018 at 03:04:18PM +0200, Vitaly Kuznetsov wrote:
    > > Christoph Hellwig <hch@lst.de> writes:
    > >
    > > > On Wed, Sep 19, 2018 at 05:15:43PM +0800, Ming Lei wrote:
    > > >> 1) does kmalloc-N slab guarantee to return N-byte aligned buffer? If
    > > >> yes, is it a stable rule?
    > > >
    > > > This is the assumption in a lot of the kernel, so I think if somethings
    > > > breaks this we are in a lot of pain.
    > >
    > > It seems that SLUB debug breaks this assumption. Kernel built with
    > >
    > > CONFIG_SLUB_DEBUG=y
    > > CONFIG_SLUB=y
    > > CONFIG_SLUB_DEBUG_ON=y
    >
    > Looks like we should fix SLUB debug then..

    Nope. We need to not make unwarranted assumptions. Alignment is guaranteed
    to ARCH_KMALLOC_MINALIGN for kmalloc requests. Fantasizing about
    alighments and guessing from alignments that result on a particular
    hardware and slab configuration that these are general does not work.

    \
     
     \ /
      Last update: 2018-09-24 18:07    [W:5.685 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site