summaryrefslogtreecommitdiff
path: root/mm/slab_common.c
diff options
context:
space:
mode:
authorVlastimil Babka <vbabka@suse.cz>2024-10-09 16:29:37 +0200
committerVlastimil Babka <vbabka@suse.cz>2024-10-29 10:43:24 +0100
commitb6da940130579769a42605b2c7f529b6f14ef1f8 (patch)
tree45f3c1e26675b135298ead16d6ee5d7cf7be99e7 /mm/slab_common.c
parentb4b797d87745f79e1d3c945dc0db4093c9ae9904 (diff)
downloadlinux-b6da940130579769a42605b2c7f529b6f14ef1f8.tar.gz
linux-b6da940130579769a42605b2c7f529b6f14ef1f8.tar.bz2
linux-b6da940130579769a42605b2c7f529b6f14ef1f8.zip
mm, slab: add kerneldocs for common SLAB_ flags
We have many SLAB_ flags but many are used only internally, by kunit tests or debugging subsystems cooperating with slab, or are set according to slab_debug boot parameter. Create kerneldocs for the commonly used flags that may be passed to kmem_cache_create(). SLAB_TYPESAFE_BY_RCU already had a detailed description, so turn it to a kerneldoc. Add some details for SLAB_ACCOUNT, SLAB_RECLAIM_ACCOUNT and SLAB_HWCACHE_ALIGN. Reference them from the __kmem_cache_create_args() kerneldoc. Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Diffstat (limited to 'mm/slab_common.c')
-rw-r--r--mm/slab_common.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/mm/slab_common.c b/mm/slab_common.c
index 9e22d1266f6a..62878edb0a81 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -254,11 +254,23 @@ out:
* @object_size: The size of objects to be created in this cache.
* @args: Additional arguments for the cache creation (see
* &struct kmem_cache_args).
- * @flags: See %SLAB_* flags for an explanation of individual @flags.
+ * @flags: See the desriptions of individual flags. The common ones are listed
+ * in the description below.
*
* Not to be called directly, use the kmem_cache_create() wrapper with the same
* parameters.
*
+ * Commonly used @flags:
+ *
+ * &SLAB_ACCOUNT - Account allocations to memcg.
+ *
+ * &SLAB_HWCACHE_ALIGN - Align objects on cache line boundaries.
+ *
+ * &SLAB_RECLAIM_ACCOUNT - Objects are reclaimable.
+ *
+ * &SLAB_TYPESAFE_BY_RCU - Slab page (not individual objects) freeing delayed
+ * by a grace period - see the full description before using.
+ *
* Context: Cannot be called within a interrupt, but can be interrupted.
*
* Return: a pointer to the cache on success, NULL on failure.