函数逻辑报告 |
Source Code:mm\vmscan.c |
Create Date:2022-07-27 15:41:13 |
Last Modify:2022-05-23 13:41:30 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:do_shrink_slab
函数原型:static unsigned long do_shrink_slab(struct shrink_control *shrinkctl, struct shrinker *shrinker, int priority)
返回类型:unsigned long
参数:
类型 | 参数 | 名称 |
---|---|---|
struct shrink_control * | shrinkctl | |
struct shrinker * | shrinker | |
int | priority |
430 | freed等于0 |
439 | scanned等于0 |
444 | freeable等于count_objects(shrinker, shrinkctl) |
445 | 如果freeable恒等于0或freeable恒等于SHRINK_EMPTY则返回:freeable |
453 | nr等于atomic_long_xchg( & bjs pending delete, per node [nid], 0) |
455 | total_scan等于nr |
456 | 如果seeks to recreate an obj 则 |
458 | delta乘等于4 |
460 | 否则 |
469 | total_scan加等于delta |
470 | 如果total_scan小于0则 |
471 | 打印错误信息("shrink_slab: %pS negative objects to delete nr=%ld\n", scan_objects, total_scan) |
473 | total_scan等于freeable |
474 | next_deferred等于nr |
475 | 否则next_deferred等于total_scan |
490 | 如果delta小于freeable除4则total_scan等于两数取小(total_scan, freeable / 2) |
498 | 如果total_scan大于freeable乘2则total_scan等于freeable乘2 |
519 | 当total_scan大于等于batch_size或total_scan大于等于freeable循环 |
522 | nr_to_scan等于两数取小(batch_size, total_scan) |
524 | How many objects scan_objects should scan and try to reclaim.* This is reset before every call, so it is safe for callees* to modify.等于nr_to_scan |
525 | How many objects did scan_objects process?* This defaults to nr_to_scan before every call, but the callee* should track its actual progress.等于nr_to_scan |
526 | ret等于scan_objects(shrinker, shrinkctl) |
527 | 如果ret恒等于SHRINK_STOP则退出 |
531 | count_vm_events(SLABS_SCANNED, How many objects did scan_objects process?* This defaults to nr_to_scan before every call, but the callee* should track its actual progress.) |
532 | total_scan减等于How many objects did scan_objects process?* This defaults to nr_to_scan before every call, but the callee* should track its actual progress. |
533 | scanned加等于How many objects did scan_objects process?* This defaults to nr_to_scan before every call, but the callee* should track its actual progress. |
535 | cond_resched() |
538 | 如果next_deferred大于等于scanned则next_deferred减等于scanned |
540 | 否则next_deferred等于0 |
547 | 如果next_deferred大于0则new_nr等于atomic_long_add_return(next_deferred, & bjs pending delete, per node [nid]) |
550 | 否则new_nr等于atomic_long_read( & bjs pending delete, per node [nid]) |
553 | trace_mm_shrink_slab_end(shrinker, nid, freed, nr, new_nr, total_scan) |
554 | 返回:freed |
名称 | 描述 |
---|---|
shrink_slab_memcg | |
shrink_slab | shrink_slab - shrink slab caches*@gfp_mask: allocation context*@nid: node whose slab caches to target*@memcg: memory cgroup whose slab caches to target*@priority: the reclaim priority* Call the shrink functions to age shrinkable caches |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |