diff options
Diffstat (limited to 'include/linux/slub_def.h')
-rw-r--r-- | include/linux/slub_def.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index 79d59c937fac..71e43a12ebbb 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h | |||
@@ -29,6 +29,7 @@ enum stat_item { | |||
29 | DEACTIVATE_TO_HEAD, /* Cpu slab was moved to the head of partials */ | 29 | DEACTIVATE_TO_HEAD, /* Cpu slab was moved to the head of partials */ |
30 | DEACTIVATE_TO_TAIL, /* Cpu slab was moved to the tail of partials */ | 30 | DEACTIVATE_TO_TAIL, /* Cpu slab was moved to the tail of partials */ |
31 | DEACTIVATE_REMOTE_FREES,/* Slab contained remotely freed objects */ | 31 | DEACTIVATE_REMOTE_FREES,/* Slab contained remotely freed objects */ |
32 | ORDER_FALLBACK, /* Number of times fallback was necessary */ | ||
32 | NR_SLUB_STAT_ITEMS }; | 33 | NR_SLUB_STAT_ITEMS }; |
33 | 34 | ||
34 | struct kmem_cache_cpu { | 35 | struct kmem_cache_cpu { |
@@ -48,11 +49,21 @@ struct kmem_cache_node { | |||
48 | struct list_head partial; | 49 | struct list_head partial; |
49 | #ifdef CONFIG_SLUB_DEBUG | 50 | #ifdef CONFIG_SLUB_DEBUG |
50 | atomic_long_t nr_slabs; | 51 | atomic_long_t nr_slabs; |
52 | atomic_long_t total_objects; | ||
51 | struct list_head full; | 53 | struct list_head full; |
52 | #endif | 54 | #endif |
53 | }; | 55 | }; |
54 | 56 | ||
55 | /* | 57 | /* |
58 | * Word size structure that can be atomically updated or read and that | ||
59 | * contains both the order and the number of objects that a slab of the | ||
60 | * given order would contain. | ||
61 | */ | ||
62 | struct kmem_cache_order_objects { | ||
63 | unsigned long x; | ||
64 | }; | ||
65 | |||
66 | /* | ||
56 | * Slab cache management. | 67 | * Slab cache management. |
57 | */ | 68 | */ |
58 | struct kmem_cache { | 69 | struct kmem_cache { |
@@ -61,7 +72,7 @@ struct kmem_cache { | |||
61 | int size; /* The size of an object including meta data */ | 72 | int size; /* The size of an object including meta data */ |
62 | int objsize; /* The size of an object without meta data */ | 73 | int objsize; /* The size of an object without meta data */ |
63 | int offset; /* Free pointer offset. */ | 74 | int offset; /* Free pointer offset. */ |
64 | int order; /* Current preferred allocation order */ | 75 | struct kmem_cache_order_objects oo; |
65 | 76 | ||
66 | /* | 77 | /* |
67 | * Avoid an extra cache line for UP, SMP and for the node local to | 78 | * Avoid an extra cache line for UP, SMP and for the node local to |
@@ -70,7 +81,8 @@ struct kmem_cache { | |||
70 | struct kmem_cache_node local_node; | 81 | struct kmem_cache_node local_node; |
71 | 82 | ||
72 | /* Allocation and freeing of slabs */ | 83 | /* Allocation and freeing of slabs */ |
73 | int objects; /* Number of objects in slab */ | 84 | struct kmem_cache_order_objects max; |
85 | struct kmem_cache_order_objects min; | ||
74 | gfp_t allocflags; /* gfp flags to use on each alloc */ | 86 | gfp_t allocflags; /* gfp flags to use on each alloc */ |
75 | int refcount; /* Refcount for slab cache destroy */ | 87 | int refcount; /* Refcount for slab cache destroy */ |
76 | void (*ctor)(struct kmem_cache *, void *); | 88 | void (*ctor)(struct kmem_cache *, void *); |