aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/slub_def.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/slub_def.h')
-rw-r--r--include/linux/slub_def.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index 070ff84240e7..a3e9492fed02 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -41,12 +41,31 @@ struct kmem_cache_cpu {
41 void **freelist; /* Pointer to next available object */ 41 void **freelist; /* Pointer to next available object */
42 unsigned long tid; /* Globally unique transaction id */ 42 unsigned long tid; /* Globally unique transaction id */
43 struct page *page; /* The slab from which we are allocating */ 43 struct page *page; /* The slab from which we are allocating */
44#ifdef CONFIG_SLUB_CPU_PARTIAL
44 struct page *partial; /* Partially allocated frozen slabs */ 45 struct page *partial; /* Partially allocated frozen slabs */
46#endif
45#ifdef CONFIG_SLUB_STATS 47#ifdef CONFIG_SLUB_STATS
46 unsigned stat[NR_SLUB_STAT_ITEMS]; 48 unsigned stat[NR_SLUB_STAT_ITEMS];
47#endif 49#endif
48}; 50};
49 51
52#ifdef CONFIG_SLUB_CPU_PARTIAL
53#define slub_percpu_partial(c) ((c)->partial)
54
55#define slub_set_percpu_partial(c, p) \
56({ \
57 slub_percpu_partial(c) = (p)->next; \
58})
59
60#define slub_percpu_partial_read_once(c) READ_ONCE(slub_percpu_partial(c))
61#else
62#define slub_percpu_partial(c) NULL
63
64#define slub_set_percpu_partial(c, p)
65
66#define slub_percpu_partial_read_once(c) NULL
67#endif // CONFIG_SLUB_CPU_PARTIAL
68
50/* 69/*
51 * Word size structure that can be atomically updated or read and that 70 * 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 71 * contains both the order and the number of objects that a slab of the