函数逻辑报告 |
Source Code:mm\slub.c |
Create Date:2022-07-27 17:22:30 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:Slow path handling. This may still be called frequently since objects* have a longer lifetime than the cpu slabs in most processing loads.* So we still attempt to reduce cache line usage. Just take the slab* lock and free the item
函数原型:static void __slab_free(struct kmem_cache *s, struct page *page, void *head, void *tail, int cnt, unsigned long addr)
返回类型:void
参数:
类型 | 参数 | 名称 |
---|---|---|
struct kmem_cache * | s | |
struct page * | page | |
void * | head | |
void * | tail | |
int | cnt | |
unsigned long | addr |
2838 | struct kmem_cache_node * n = NULL |
2841 | stat(s, Freeing not to cpu slab ) |
2847 | 循环 |
2848 | 如果此条件成立可能性小(为编译器优化)(n)则 |
2849 | spin_unlock_irqrestore( & list_lock, flags) |
2850 | n = NULL |
2852 | prior等于 first free object |
2854 | set_freepointer(s, tail, prior) |
2856 | was_frozen等于frozen |
2858 | 如果非 SLUB 或非prior的值且非was_frozen则 |
2860 | 如果kmem_cache_has_cpu_partial(s)且非prior则 |
2868 | frozen等于1 |
2870 | 否则 |
2872 | n等于get_node(s, page_to_nid(page)) |
2881 | spin_lock_irqsave( & list_lock, flags) |
2891 | 如果此条件成立可能性大(为编译器优化)(!n)则 |
2897 | 如果frozen且非was_frozen则 |
2898 | put_cpu_partial(s, page, 1) |
2899 | stat(s, Refill cpu partial on free ) |
2905 | 如果was_frozen则stat(s, Freeing to frozen slab ) |
2907 | 返回 |
2910 | 如果此条件成立可能性小(为编译器优化)(! SLUB && nr_partial >= min_partial)则转到:slab_empty |
2917 | 如果非kmem_cache_has_cpu_partial(s)且此条件成立可能性小(为编译器优化)(!prior)则 |
2918 | remove_full(s, n, page) |
2920 | stat(s, Freeing moves slab to partial list ) |
2922 | spin_unlock_irqrestore( & list_lock, flags) |
2923 | 返回 |
2925 | slab_empty : |
2926 | 如果prior则 |
2930 | remove_partial(n, page) |
2931 | stat(s, Freeing removes last object ) |
2932 | 否则 |
2934 | remove_full(s, n, page) |
2937 | spin_unlock_irqrestore( & list_lock, flags) |
2938 | stat(s, Slab freed to the page allocator ) |
2939 | discard_slab(s, page) |
名称 | 描述 |
---|---|
do_slab_free | Fastpath with forced inlining to produce a kfree and kmem_cache_free that* can perform fastpath freeing without additional function calls.* The fastpath is only possible if we are freeing to the current cpu slab* of this processor |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |