Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm/slab, docs: switch mm-api docs generation from slab.c to slub.c

The SLAB implementation is going to be removed, and mm-api.rst currently
uses mm/slab.c to obtain kerneldocs for some API functions. Switch it to
mm/slub.c and move the relevant kerneldocs of exported functions from
one to the other. The rest of kerneldocs in slab.c is for static SLAB
implementation-specific functions that don't have counterparts in slub.c
and thus can be simply removed with the implementation.

Acked-by: David Rientjes <rientjes@google.com>
Tested-by: David Rientjes <rientjes@google.com>
Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>

+22 -22
+1 -1
Documentation/core-api/mm-api.rst
··· 37 37 .. kernel-doc:: include/linux/slab.h 38 38 :internal: 39 39 40 - .. kernel-doc:: mm/slab.c 40 + .. kernel-doc:: mm/slub.c 41 41 :export: 42 42 43 43 .. kernel-doc:: mm/slab_common.c
-21
mm/slab.c
··· 3491 3491 } 3492 3492 EXPORT_SYMBOL(kmem_cache_alloc_bulk); 3493 3493 3494 - /** 3495 - * kmem_cache_alloc_node - Allocate an object on the specified node 3496 - * @cachep: The cache to allocate from. 3497 - * @flags: See kmalloc(). 3498 - * @nodeid: node number of the target node. 3499 - * 3500 - * Identical to kmem_cache_alloc but it will allocate memory on the given 3501 - * node, which can improve the performance for cpu bound structures. 3502 - * 3503 - * Fallback to other node is possible if __GFP_THISNODE is not set. 3504 - * 3505 - * Return: pointer to the new object or %NULL in case of error 3506 - */ 3507 3494 void *kmem_cache_alloc_node(struct kmem_cache *cachep, gfp_t flags, int nodeid) 3508 3495 { 3509 3496 void *ret = slab_alloc_node(cachep, NULL, flags, nodeid, cachep->object_size, _RET_IP_); ··· 3551 3564 __do_kmem_cache_free(cachep, objp, caller); 3552 3565 } 3553 3566 3554 - /** 3555 - * kmem_cache_free - Deallocate an object 3556 - * @cachep: The cache the allocation was from. 3557 - * @objp: The previously allocated object. 3558 - * 3559 - * Free an object which was previously allocated from this 3560 - * cache. 3561 - */ 3562 3567 void kmem_cache_free(struct kmem_cache *cachep, void *objp) 3563 3568 { 3564 3569 cachep = cache_from_obj(cachep, objp);
+21
mm/slub.c
··· 3518 3518 caller, orig_size); 3519 3519 } 3520 3520 3521 + /** 3522 + * kmem_cache_alloc_node - Allocate an object on the specified node 3523 + * @s: The cache to allocate from. 3524 + * @gfpflags: See kmalloc(). 3525 + * @node: node number of the target node. 3526 + * 3527 + * Identical to kmem_cache_alloc but it will allocate memory on the given 3528 + * node, which can improve the performance for cpu bound structures. 3529 + * 3530 + * Fallback to other node is possible if __GFP_THISNODE is not set. 3531 + * 3532 + * Return: pointer to the new object or %NULL in case of error 3533 + */ 3521 3534 void *kmem_cache_alloc_node(struct kmem_cache *s, gfp_t gfpflags, int node) 3522 3535 { 3523 3536 void *ret = slab_alloc_node(s, NULL, gfpflags, node, _RET_IP_, s->object_size); ··· 3835 3822 slab_free(s, virt_to_slab(x), x, NULL, &x, 1, caller); 3836 3823 } 3837 3824 3825 + /** 3826 + * kmem_cache_free - Deallocate an object 3827 + * @s: The cache the allocation was from. 3828 + * @x: The previously allocated object. 3829 + * 3830 + * Free an object which was previously allocated from this 3831 + * cache. 3832 + */ 3838 3833 void kmem_cache_free(struct kmem_cache *s, void *x) 3839 3834 { 3840 3835 s = cache_from_obj(s, x);