~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/slub_def.h

Version: ~ [ linux-5.5 ] ~ [ linux-5.4.15 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.98 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.167 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.211 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.211 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.81 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #ifndef _LINUX_SLUB_DEF_H
  2 #define _LINUX_SLUB_DEF_H
  3 
  4 /*
  5  * SLUB : A Slab allocator without object queues.
  6  *
  7  * (C) 2007 SGI, Christoph Lameter
  8  */
  9 #include <linux/kobject.h>
 10 
 11 enum stat_item {
 12         ALLOC_FASTPATH,         /* Allocation from cpu slab */
 13         ALLOC_SLOWPATH,         /* Allocation by getting a new cpu slab */
 14         FREE_FASTPATH,          /* Free to cpu slub */
 15         FREE_SLOWPATH,          /* Freeing not to cpu slab */
 16         FREE_FROZEN,            /* Freeing to frozen slab */
 17         FREE_ADD_PARTIAL,       /* Freeing moves slab to partial list */
 18         FREE_REMOVE_PARTIAL,    /* Freeing removes last object */
 19         ALLOC_FROM_PARTIAL,     /* Cpu slab acquired from node partial list */
 20         ALLOC_SLAB,             /* Cpu slab acquired from page allocator */
 21         ALLOC_REFILL,           /* Refill cpu slab from slab freelist */
 22         ALLOC_NODE_MISMATCH,    /* Switching cpu slab */
 23         FREE_SLAB,              /* Slab freed to the page allocator */
 24         CPUSLAB_FLUSH,          /* Abandoning of the cpu slab */
 25         DEACTIVATE_FULL,        /* Cpu slab was full when deactivated */
 26         DEACTIVATE_EMPTY,       /* Cpu slab was empty when deactivated */
 27         DEACTIVATE_TO_HEAD,     /* Cpu slab was moved to the head of partials */
 28         DEACTIVATE_TO_TAIL,     /* Cpu slab was moved to the tail of partials */
 29         DEACTIVATE_REMOTE_FREES,/* Slab contained remotely freed objects */
 30         DEACTIVATE_BYPASS,      /* Implicit deactivation */
 31         ORDER_FALLBACK,         /* Number of times fallback was necessary */
 32         CMPXCHG_DOUBLE_CPU_FAIL,/* Failure of this_cpu_cmpxchg_double */
 33         CMPXCHG_DOUBLE_FAIL,    /* Number of times that cmpxchg double did not match */
 34         CPU_PARTIAL_ALLOC,      /* Used cpu partial on alloc */
 35         CPU_PARTIAL_FREE,       /* Refill cpu partial on free */
 36         CPU_PARTIAL_NODE,       /* Refill cpu partial from node partial */
 37         CPU_PARTIAL_DRAIN,      /* Drain cpu partial to node partial */
 38         NR_SLUB_STAT_ITEMS };
 39 
 40 struct kmem_cache_cpu {
 41         void **freelist;        /* Pointer to next available object */
 42         unsigned long tid;      /* Globally unique transaction id */
 43         struct page *page;      /* The slab from which we are allocating */
 44         struct page *partial;   /* Partially allocated frozen slabs */
 45 #ifdef CONFIG_SLUB_STATS
 46         unsigned stat[NR_SLUB_STAT_ITEMS];
 47 #endif
 48 };
 49 
 50 /*
 51  * Word size structure that can be atomically updated or read and that
 52  * contains both the order and the number of objects that a slab of the
 53  * given order would contain.
 54  */
 55 struct kmem_cache_order_objects {
 56         unsigned long x;
 57 };
 58 
 59 /*
 60  * Slab cache management.
 61  */
 62 struct kmem_cache {
 63         struct kmem_cache_cpu __percpu *cpu_slab;
 64         /* Used for retriving partial slabs etc */
 65         unsigned long flags;
 66         unsigned long min_partial;
 67         int size;               /* The size of an object including meta data */
 68         int object_size;        /* The size of an object without meta data */
 69         int offset;             /* Free pointer offset. */
 70         int cpu_partial;        /* Number of per cpu partial objects to keep around */
 71         struct kmem_cache_order_objects oo;
 72 
 73         /* Allocation and freeing of slabs */
 74         struct kmem_cache_order_objects max;
 75         struct kmem_cache_order_objects min;
 76         gfp_t allocflags;       /* gfp flags to use on each alloc */
 77         int refcount;           /* Refcount for slab cache destroy */
 78         void (*ctor)(void *);
 79         int inuse;              /* Offset to metadata */
 80         int align;              /* Alignment */
 81         int reserved;           /* Reserved bytes at the end of slabs */
 82         const char *name;       /* Name (only for display!) */
 83         struct list_head list;  /* List of slab caches */
 84 #ifdef CONFIG_SYSFS
 85         struct kobject kobj;    /* For sysfs */
 86 #endif
 87 #ifdef CONFIG_MEMCG_KMEM
 88         struct memcg_cache_params *memcg_params;
 89         int max_attr_size; /* for propagation, maximum size of a stored attr */
 90 #endif
 91 
 92 #ifdef CONFIG_NUMA
 93         /*
 94          * Defragmentation by allocating from a remote node.
 95          */
 96         int remote_node_defrag_ratio;
 97 #endif
 98         struct kmem_cache_node *node[MAX_NUMNODES];
 99 };
100 
101 #endif /* _LINUX_SLUB_DEF_H */
102 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp