aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-07 21:22:29 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-07 21:22:29 -0500
commitc00f08d705e149fbfaf7a252b4d4fbb7affdcc96 (patch)
tree8c916856376d0d400ddda239d5be386f9b9516d7 /include
parentc8b6de16d9434405e5832b8772e4f986ddd5118e (diff)
parent3adbefee6fd58a061b2bf1df4f3769701860fc62 (diff)
Merge branch 'slub-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/christoph/vm
* 'slub-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/christoph/vm: SLUB: fix checkpatch warnings Use non atomic unlock SLUB: Support for performance statistics SLUB: Alternate fast paths using cmpxchg_local SLUB: Use unique end pointer for each slab page. SLUB: Deal with annoying gcc warning on kfree()
Diffstat (limited to 'include')
-rw-r--r--include/linux/mm_types.h5
-rw-r--r--include/linux/slub_def.h23
2 files changed, 27 insertions, 1 deletions
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 34023c65d466..bfee0bd1d435 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -64,7 +64,10 @@ struct page {
64#if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS 64#if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS
65 spinlock_t ptl; 65 spinlock_t ptl;
66#endif 66#endif
67 struct kmem_cache *slab; /* SLUB: Pointer to slab */ 67 struct {
68 struct kmem_cache *slab; /* SLUB: Pointer to slab */
69 void *end; /* SLUB: end marker */
70 };
68 struct page *first_page; /* Compound tail pages */ 71 struct page *first_page; /* Compound tail pages */
69 }; 72 };
70 union { 73 union {
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index ddb1a706b144..5e6d3d634d5b 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -11,12 +11,35 @@
11#include <linux/workqueue.h> 11#include <linux/workqueue.h>
12#include <linux/kobject.h> 12#include <linux/kobject.h>
13 13
14enum stat_item {
15 ALLOC_FASTPATH, /* Allocation from cpu slab */
16 ALLOC_SLOWPATH, /* Allocation by getting a new cpu slab */
17 FREE_FASTPATH, /* Free to cpu slub */
18 FREE_SLOWPATH, /* Freeing not to cpu slab */
19 FREE_FROZEN, /* Freeing to frozen slab */
20 FREE_ADD_PARTIAL, /* Freeing moves slab to partial list */
21 FREE_REMOVE_PARTIAL, /* Freeing removes last object */
22 ALLOC_FROM_PARTIAL, /* Cpu slab acquired from partial list */
23 ALLOC_SLAB, /* Cpu slab acquired from page allocator */
24 ALLOC_REFILL, /* Refill cpu slab from slab freelist */
25 FREE_SLAB, /* Slab freed to the page allocator */
26 CPUSLAB_FLUSH, /* Abandoning of the cpu slab */
27 DEACTIVATE_FULL, /* Cpu slab was full when deactivated */
28 DEACTIVATE_EMPTY, /* Cpu slab was empty when deactivated */
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 */
31 DEACTIVATE_REMOTE_FREES,/* Slab contained remotely freed objects */
32 NR_SLUB_STAT_ITEMS };
33
14struct kmem_cache_cpu { 34struct kmem_cache_cpu {
15 void **freelist; /* Pointer to first free per cpu object */ 35 void **freelist; /* Pointer to first free per cpu object */
16 struct page *page; /* The slab from which we are allocating */ 36 struct page *page; /* The slab from which we are allocating */
17 int node; /* The node of the page (or -1 for debug) */ 37 int node; /* The node of the page (or -1 for debug) */
18 unsigned int offset; /* Freepointer offset (in word units) */ 38 unsigned int offset; /* Freepointer offset (in word units) */
19 unsigned int objsize; /* Size of an object (from kmem_cache) */ 39 unsigned int objsize; /* Size of an object (from kmem_cache) */
40#ifdef CONFIG_SLUB_STATS
41 unsigned stat[NR_SLUB_STAT_ITEMS];
42#endif
20}; 43};
21 44
22struct kmem_cache_node { 45struct kmem_cache_node {