aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/slab.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/slab.h')
-rw-r--r--include/linux/slab.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 71829efc40ba..a015236cc572 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -32,9 +32,6 @@ typedef struct kmem_cache kmem_cache_t __deprecated;
32#define SLAB_MEM_SPREAD 0x00100000UL /* Spread some memory over cpuset */ 32#define SLAB_MEM_SPREAD 0x00100000UL /* Spread some memory over cpuset */
33#define SLAB_TRACE 0x00200000UL /* Trace allocations and frees */ 33#define SLAB_TRACE 0x00200000UL /* Trace allocations and frees */
34 34
35/* Flags passed to a constructor functions */
36#define SLAB_CTOR_CONSTRUCTOR 0x001UL /* If not set, then deconstructor */
37
38/* 35/*
39 * struct kmem_cache related prototypes 36 * struct kmem_cache related prototypes
40 */ 37 */
@@ -77,6 +74,21 @@ static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep,
77#endif 74#endif
78 75
79/* 76/*
77 * The largest kmalloc size supported by the slab allocators is
78 * 32 megabyte (2^25) or the maximum allocatable page order if that is
79 * less than 32 MB.
80 *
81 * WARNING: Its not easy to increase this value since the allocators have
82 * to do various tricks to work around compiler limitations in order to
83 * ensure proper constant folding.
84 */
85#define KMALLOC_SHIFT_HIGH ((MAX_ORDER + PAGE_SHIFT) <= 25 ? \
86 (MAX_ORDER + PAGE_SHIFT) : 25)
87
88#define KMALLOC_MAX_SIZE (1UL << KMALLOC_SHIFT_HIGH)
89#define KMALLOC_MAX_ORDER (KMALLOC_SHIFT_HIGH - PAGE_SHIFT)
90
91/*
80 * Common kmalloc functions provided by all allocators 92 * Common kmalloc functions provided by all allocators
81 */ 93 */
82void *__kmalloc(size_t, gfp_t); 94void *__kmalloc(size_t, gfp_t);
@@ -233,9 +245,6 @@ extern void *__kmalloc_node_track_caller(size_t, gfp_t, int, void *);
233 245
234#endif /* DEBUG_SLAB */ 246#endif /* DEBUG_SLAB */
235 247
236extern const struct seq_operations slabinfo_op;
237ssize_t slabinfo_write(struct file *, const char __user *, size_t, loff_t *);
238
239#endif /* __KERNEL__ */ 248#endif /* __KERNEL__ */
240#endif /* _LINUX_SLAB_H */ 249#endif /* _LINUX_SLAB_H */
241 250