Function report |
Source Code:mm\vmscan.c |
Create Date:2022-07-28 14:19:56 |
| Last Modify:2022-05-23 13:41:30 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name: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.
Proto:static int balance_pgdat(pg_data_t *pgdat, int order, int classzone_idx)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| 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 | When i <= classzone_idx cycle |
| 3599 | zone = node_zones + i |
| 3603 | nr_boost_reclaim += watermark_boost |
| 3604 | zone_boosts[i] = watermark_boost |
| 3606 | boosted = nr_boost_reclaim |
| 3608 | restart : |
| 3610 | Do |
| 3612 | bool raise_priority = true |
| 3628 | If buffer_heads_over_limit Then |
| 3630 | zone = node_zones + i |
| 3635 | Break |
| 3646 | balanced = Returns true if there is an eligible zone balanced for the request order* and classzone_idx |
| 3647 | If Not balanced && nr_boost_reclaim Then |
| 3648 | nr_boost_reclaim = 0 |
| 3649 | Go to restart |
| 3657 | If Not nr_boost_reclaim && balanced Then Go to 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 -= min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(nr_boost_reclaim, nr_reclaimed) |
| 3731 | If nr_boost_reclaim && Not nr_reclaimed Then Break |
| 3734 | If raise_priority || Not nr_reclaimed Then Scan (total_size >> priority) pages at once -- |
| 3736 | When Scan (total_size >> priority) pages at once >= 1 cycle |
| 3738 | If Not Number of pages freed so far during a call to shrink_zones() Then Number of 'reclaimed == 0' runs ++ |
| 3741 | out : |
| 3743 | If boosted Then |
| 3746 | When i <= classzone_idx cycle |
| 3747 | If Not zone_boosts[i] Then Continue |
| 3751 | zone = node_zones + i |
| 3752 | spin_lock_irqsave( & Primarily protects free_area , flags) |
| 3764 | snapshot_refaults(NULL, pgdat) |
| 3765 | __fs_reclaim_release() |
| 3767 | set_task_reclaim_state(current process, NULL) |
| 3775 | Return Allocation order |
| Name | Describe |
|---|---|
| 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 |
| 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 |