[lkml]   [2004]   [Oct]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subject[PATCH] 2.6.9-rc3-mm2 alloc_percpu fix for non-NUMA

    alloc_percpu() calls kmem_cache_alloc_node() to allocate memory
    on a particular node. But for non-NUMA cases, it doesn't matter
    all the memory comes from same node. This patch short-cuts and
    calls kmalloc() if its non-NUMA. I hate to add #ifdefs in the
    mainline code, but I don't see easy way around.

    kmem_cache_alloc_node()allocates a new slab to satisfy allocation
    from that node instead of doing it from a partial slab from that node
    - which causes fragmentation (with my scsi-debug tests). Thats my
    next problem to deal with.

    BTW, with this patch size-64 cache is no longer fragmented for
    scsi-debug test case.

    size-64 76920 76921 64 61 1 : tunables 120 60
    8 : slabdata 1261 1261 0


    --- 2004-10-07 07:55:05.451137928 -0700
    +++ linux-2.6.9-rc3/mm/slab.c 2004-10-07 07:55:56.990160360 -0700
    @@ -2452,9 +2452,13 @@ void *__alloc_percpu(size_t size, size_t
    for (i = 0; i < NR_CPUS; i++) {
    if (!cpu_possible(i))
    +#ifdef CONFIG_NUMA
    pdata->ptrs[i] = kmem_cache_alloc_node(
    kmem_find_general_cachep(size, GFP_KERNEL),
    + pdata->ptrs[i] = kmalloc(size, GFP_KERNEL);

    if (!pdata->ptrs[i])
    goto unwind_oom;
     \ /
      Last update: 2005-03-22 14:06    [W:0.040 / U:0.228 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site