[lkml]   [2013]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Subject[PATCH 00/16] slab: overload struct slab over struct page to reduce memory usage
    There is two main topics in this patchset. One is to reduce memory usage
    and the other is to change a management method of free objects of a slab.

    The SLAB allocate a struct slab for each slab. The size of this structure
    except bufctl array is 40 bytes on 64 bits machine. We can reduce memory
    waste and cache footprint if we overload struct slab over struct page.

    And this patchset change a management method of free objects of a slab.
    Current free objects management method of the slab is weird, because
    it touch random position of the array of kmem_bufctl_t when we try to
    get free object. See following example.

    struct slab's free = 6
    kmem_bufctl_t array: 1 END 5 7 0 4 3 2

    To get free objects, we access this array with following pattern.
    6 -> 3 -> 7 -> 2 -> 5 -> 4 -> 0 -> 1 -> END

    If we have many objects, this array would be larger and be not in the same
    cache line. It is not good for performance.

    We can do same thing through more easy way, like as the stack.
    This patchset implement it and remove complex code for above algorithm.
    This makes slab code much cleaner.

    This patchset is based on v3.11-rc6, but tested on v3.10.


    Joonsoo Kim (16):
    slab: correct pfmemalloc check
    slab: change return type of kmem_getpages() to struct page
    slab: remove colouroff in struct slab
    slab: remove nodeid in struct slab
    slab: remove cachep in struct slab_rcu
    slab: put forward freeing slab management object
    slab: overloading the RCU head over the LRU for RCU free
    slab: use well-defined macro, virt_to_slab()
    slab: use __GFP_COMP flag for allocating slab pages
    slab: change the management method of free objects of the slab
    slab: remove kmem_bufctl_t
    slab: remove SLAB_LIMIT
    slab: replace free and inuse in struct slab with newly introduced
    slab: use struct page for slab management
    slab: remove useless statement for checking pfmemalloc
    slab: rename slab_bufctl to slab_freelist

    include/linux/mm_types.h | 21 +-
    include/linux/slab.h | 9 +-
    include/linux/slab_def.h | 4 +-
    mm/slab.c | 563 ++++++++++++++++++----------------------------
    4 files changed, 237 insertions(+), 360 deletions(-)


     \ /
      Last update: 2013-08-22 11:21    [W:0.026 / U:14.080 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site