Function report |
Source Code:mm\slab.c |
Create Date:2022-07-28 15:44:29 |
Last Modify:2022-05-23 17:02:55 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:__kmem_cache_create - Create a cache.*@cachep: cache management descriptor*@flags: SLAB flags* Returns a ptr to the cache on success, NULL on failure.* Cannot be called within a int, but can be interrupted.
Proto:int __kmem_cache_create(struct kmem_cache *cachep, slab_flags_t flags)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
struct kmem_cache * | cachep | |
slab_flags_t | flags |
1990 | If flags & DEBUG: Red zone objs in a cache Then |
1991 | ralign = REDZONE_ALIGN |
1994 | size = @a is a power of 2 value (size, REDZONE_ALIGN) |
2002 | If ralign > __alignof__(unsignedlonglong) Then flags &= ~(DEBUG: Red zone objs in a cache | DEBUG: Store the last owner for bug hunting ) |
2008 | colour_off = cache_line_size() |
2010 | If colour_off < Alignment Then colour_off = Alignment |
2013 | If slab_is_available() Then gfp = GFP_KERNEL |
2015 | Else gfp = GFP_NOWAIT |
2041 | kasan_cache_create(cachep, & size, & flags) |
2043 | size = @a is a power of 2 value (size, Alignment ) |
2074 | If set_objfreelist_slab_cache(cachep, size, flags) Then |
2075 | flags |= CFLGS_OBJFREELIST_SLAB |
2076 | Go to done |
2079 | If set_off_slab_cache(cachep, size, flags) Then |
2080 | flags |= CFLGS_OFF_SLAB |
2081 | Go to done |
2084 | If set_on_slab_cache(cachep, size, flags) Then Go to done |
2087 | Return -E2BIG |
2089 | done : |
2090 | freelist_size = num * sizeof(freelist_idx_t) |
2093 | If flags & Use GFP_DMA memory Then gfp flags to use on each alloc |= GFP_DMA |
2095 | If flags & Use GFP_DMA32 memory Then gfp flags to use on each alloc |= GFP_DMA32 |
2100 | reciprocal_buffer_size = For a description of the algorithm please have a look at* include/linux/reciprocal_div.h |
2115 | freelist_cache = kmalloc_slab(freelist_size, 0u) |
2119 | err = setup_cpu_cache(cachep, gfp) |
2120 | If err Then |
2121 | __kmem_cache_release(cachep) |
2122 | Return err |
2125 | Return 0 |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |