[lkml]   [2007]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    SubjectRe: Oops in a driver while using SLUB as a SLAB allocator
    Here is the corresponding PA-RISC piece. Its as straightforward as 
    the other one since the only way to make this work properly in the past
    was if the sizes passed to the dma alloc functions are page size based.

    PA-RISC: Use page allocator instead of slab allocator.

    Slab pages obtained via kmalloc are not cachline aligned. Nor is it advisable
    to perform VM operations designed for page allocator pages on
    memory obtained via kmalloc.

    So replace the page sized allocations in kernel/pci-dma.c with page allocator

    Signed-off-by: Christoph Lameter <>

    arch/parisc/kernel/pci-dma.c | 4 ++--
    include/linux/mm.h | 5 +----
    2 files changed, 3 insertions(+), 6 deletions(-)

    Index: linux-2.6/arch/parisc/kernel/pci-dma.c
    --- linux-2.6.orig/arch/parisc/kernel/pci-dma.c 2007-06-22 13:02:32.000000000 -0700
    +++ linux-2.6/arch/parisc/kernel/pci-dma.c 2007-06-22 13:06:39.000000000 -0700
    @@ -572,7 +572,7 @@ static void *pa11_dma_alloc_noncoherent(
    void *addr = NULL;

    /* rely on kmalloc to be cacheline aligned */
    - addr = kmalloc(size, flag);
    + addr = (void *)__get_free_pages(flag, get_order(size));
    *dma_handle = (dma_addr_t)virt_to_phys(addr);

    @@ -582,7 +582,7 @@ static void *pa11_dma_alloc_noncoherent(
    static void pa11_dma_free_noncoherent(struct device *dev, size_t size,
    void *vaddr, dma_addr_t iova)
    - kfree(vaddr);
    + free_pages((unsigned long)vaddr, get_order(size));

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2007-06-22 22:17    [W:0.019 / U:37.324 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site