Re: A couple of questions about slabifo

From: Kasper Dupont (kasperd_at_daimi.au.dk)
Date: 01/18/05

  • Next message: Kasper Dupont: "Re: No swap partition ?"
    Date: Tue, 18 Jan 2005 07:58:49 +0100
    
    

    Ilya wrote:
    >
    > Hi:
    >
    > Just two clarification questions that should be easy to answer by the
    > knowing ones:
    >
    > 1. Does all the dynamic memory allocated in the kernel listed in the
    > /proc/slabinfo file?

    No.

    > There isn't any more memory that kernel uses which
    > is not reflected in slabinfo?

    There is. You can do allocations at different layers.
    At the lowest layer we have functions dealing with
    allocation of pages, for example the get_free_pages
    function. Just about any allocation must be build on
    top of this layer. But this lowest layer doesn't
    export such useful data about allocations.

    On the next layer we have the slab allocator. The
    primary purpose of slab allocations is to allow
    allocation of small objects without having to use a
    full page for each object.

    Again on top of the slab allocator we have kmalloc
    which is intended for small variable size allocations.
    Or any small allocation you do so rarely that it
    doesn't make sense for it to have its own slab.

    >
    > 2. There are several rows at the bottom of slabinfo file that all start
    > with 'size-'. Are they represent the memory allocated for the 'buddy'
    > allocation system?

    No, the buddy allocator is a lower layer. The size-
    slabs are those used by kmalloc. But from one page
    and up, it is a good idea for the size- slabs to
    match the sizes supported by the underlying buddy
    allocator.

    > Also, what is the physical difference between the
    > size-xxx and size-xxx(DMA)?

    Architecture dependent I guess. But AFAIR on i386
    the DMA allocations are below 16MB.

    >
    > 3. Is there a fundamental difference between the inode_cache line in
    > /proc/slabinfo and the 'Cached' line in the /proc/memifo?

    They are completely unrelated. The inode_cache line
    will tell you how many inodes are currently cached.

    The Cached line in /proc/meminfo will tell you how
    many pages of file contents is currently cached.

    -- 
    Kasper Dupont
    

  • Next message: Kasper Dupont: "Re: No swap partition ?"

    Relevant Pages

    • Re: race on multi-processor solaris
      ... The point of the magazine layer is to take a single-threaded, ... there have been 3.3 billion allocations and frees.Those generated ... slab-layer allocations and frees. ...
      (comp.unix.solaris)
    • Re: [PATCH 01/03] Cpuset: might sleep checking zones allowed fix
      ... First have a lower layer that is simply allocating a page from a zone ... Second a middle layer where one must explicitly specify cpuset and policy ... And thirdly a higher layer that obtains policies and cpuset constraints ... Allocations can then use the proper layer for their allocations. ...
      (Linux-Kernel)
    • Re: [patch 2/2] slub: enforce cpuset restrictions for cpu slabs
      ... assigned to a disjoint cpuset. ... This would get us back to the slab allocator enforcing memory policies. ... fastpath for off node allocations. ...
      (Linux-Kernel)