函数逻辑报告 |
Source Code:mm\vmscan.c |
Create Date:2022-07-27 15:43:52 |
Last Modify:2022-05-23 13:41:30 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:For kswapd, balance_pgdat() will reclaim pages across a node from zones* that are eligible for use by the caller until at least one zone is* balanced.* Returns the order kswapd finished reclaiming at.
函数原型:static int balance_pgdat(pg_data_t *pgdat, int order, int classzone_idx)
返回类型:int
参数:
类型 | 参数 | 名称 |
---|---|---|
pg_data_t * | pgdat | |
int | order | |
int | classzone_idx |
3577 | unsigned long zone_boosts[MAX_NR_ZONES] = {0, } |
3580 | struct scan_control sc = { This context's GFP mask = GFP_KERNEL, Allocation order = order, Can mapped pages be reclaimed? = 1, } |
3588 | __fs_reclaim_acquire() |
3590 | Disable counters |
3597 | nr_boost_reclaim等于0 |
3598 | 以i小于等于classzone_idx循环 |
3599 | zone等于包含了结点中各内存域的数据结构加i |
3603 | nr_boost_reclaim加等于watermark_boost |
3604 | zone_boosts[i]等于watermark_boost |
3606 | boosted等于nr_boost_reclaim |
3608 | restart : |
3610 | 循环 |
3612 | bool raise_priority = true |
3628 | 如果buffer_heads_over_limit则 |
3630 | zone等于包含了结点中各内存域的数据结构加i |
3635 | 退出 |
3646 | balanced等于Returns true if there is an eligible zone balanced for the request order* and classzone_idx |
3647 | 如果非balanced且nr_boost_reclaim则 |
3648 | nr_boost_reclaim等于0 |
3649 | 转到:restart |
3657 | 如果非nr_boost_reclaim且balanced则转到:out |
3679 | age_active_anon(pgdat, & sc) |
3690 | nr_soft_scanned等于0 |
3691 | nr_soft_reclaimed等于mem_cgroup_soft_limit_reclaim(pgdat, Allocation order , This context's GFP mask , & nr_soft_scanned) |
3713 | __fs_reclaim_release() |
3714 | ret等于try_to_freeze() |
3715 | __fs_reclaim_acquire() |
3724 | nr_boost_reclaim减等于两数取小(nr_boost_reclaim, nr_reclaimed) |
3731 | 如果nr_boost_reclaim且非nr_reclaimed则退出 |
3736 | 当 Scan (total_size >> priority) pages at once 大于等于1循环 |
3738 | 如果非 Number of pages freed so far during a call to shrink_zones() 则 Number of 'reclaimed == 0' runs 自加 |
3741 | out : |
3743 | 如果boosted则 |
3746 | 以i小于等于classzone_idx循环 |
3747 | 如果非zone_boosts[i]则继续下一循环 |
3751 | zone等于包含了结点中各内存域的数据结构加i |
3752 | spin_lock_irqsave( & 自旋锁, flags) |
3753 | watermark_boost减等于两数取小(watermark_boost, zone_boosts[i]) |
3754 | spin_unlock_irqrestore( & 自旋锁, flags) |
3764 | snapshot_refaults(NULL, pgdat) |
3765 | __fs_reclaim_release() |
3767 | set_task_reclaim_state(当前进程, NULL) |
3775 | 返回: Allocation order |
名称 | 描述 |
---|---|
kswapd | The background pageout daemon, started as a kernel thread* from the init process.* This basically trickles out pages so that we have _some_* free memory available even if there is no other activity* that frees anything up |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |