summaryrefslogtreecommitdiff
path: root/kern/slab.h
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2012-12-01 15:44:12 +0100
committerJustus Winter <4winter@informatik.uni-hamburg.de>2015-08-28 15:48:04 +0200
commit89ea8fc44d2e07f9611c65a1181cec2bb80d29c2 (patch)
tree217852c426b0c04042d40f95419422d9695c8444 /kern/slab.h
parentbed2bd6853ff405f5656156ccf9f5970aa66946f (diff)
kern/slab: remove the KMEM_CACHE_NORECLAIM flag
Don't encourage anyone to use non reclaimable pools of resources, it's a Bad Thing To Do.
Diffstat (limited to 'kern/slab.h')
-rw-r--r--kern/slab.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/kern/slab.h b/kern/slab.h
index c7be169..bbd9d41 100644
--- a/kern/slab.h
+++ b/kern/slab.h
@@ -155,6 +155,16 @@ typedef void (*kmem_slab_free_fn_t)(vm_offset_t, vm_size_t);
#define KMEM_CACHE_NAME_SIZE 24
/*
+ * Cache flags.
+ *
+ * The flags don't change once set and can be tested without locking.
+ */
+#define KMEM_CF_NO_CPU_POOL 0x1 /* CPU pool layer disabled */
+#define KMEM_CF_SLAB_EXTERNAL 0x2 /* Slab data is off slab */
+#define KMEM_CF_VERIFY 0x4 /* Debugging facilities enabled */
+#define KMEM_CF_DIRECT 0x8 /* No buf-to-slab tree lookup */
+
+/*
* Cache of objects.
*
* Locking order : cpu_pool -> cache. CPU pools locking is ordered by CPU ID.
@@ -215,12 +225,13 @@ extern vm_map_t kmem_map;
*/
#define KMEM_CACHE_NOCPUPOOL 0x1 /* Don't use the per-cpu pools */
#define KMEM_CACHE_NOOFFSLAB 0x2 /* Don't allocate external slab data */
-#define KMEM_CACHE_NORECLAIM 0x4 /* Never give slabs back to their source,
- implies KMEM_CACHE_NOOFFSLAB */
-#define KMEM_CACHE_VERIFY 0x8 /* Use debugging facilities */
+#define KMEM_CACHE_VERIFY 0x4 /* Use debugging facilities */
/*
* Initialize a cache.
+ *
+ * If a slab allocation/free function pointer is NULL, the default backend
+ * (vm_kmem on the kernel map) is used for the allocation/free action.
*/
void kmem_cache_init(struct kmem_cache *cache, const char *name,
size_t obj_size, size_t align, kmem_cache_ctor_t ctor,