Function report |
Source Code:mm\page-writeback.c |
Create Date:2022-07-28 14:10:34 |
Last Modify:2022-05-23 13:25:58 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:alance_dirty_pages() must be called by processes which are generating dirty* data
Proto:static void balance_dirty_pages(struct bdi_writeback *wb, unsigned long pages_dirtied)
Type:void
Parameter:
Type | Parameter | Name |
---|---|---|
struct bdi_writeback * | wb | |
unsigned long | pages_dirtied |
1564 | struct dirty_throttle_control gdtc_stor = {GDTC_INIT(wb)} |
1565 | struct dirty_throttle_control mdtc_stor = {MDTC_INIT(wb, & gdtc_stor)} |
1567 | struct dirty_throttle_control * const mdtc = mdtc_valid( & mdtc_stor) ? & mdtc_stor : NULL |
1576 | bool dirty_exceeded = false |
1579 | bdi = ur parent bdi |
1581 | start_time = jiffies |
1583 | cycle |
1586 | m_dirty = 0 |
1587 | m_thresh = 0 |
1588 | m_bg_thresh = 0 |
1596 | nr_reclaimable = global_node_page_state(NR_FILE_DIRTY) + global_node_page_state(NR_UNSTABLE_NFS) |
1609 | Else |
1610 | dirty = le_dirty + write + nfs |
1611 | thresh = dirty threshold |
1615 | If mdtc Then |
1622 | mem_cgroup_wb_stats(wb, & filepages, & headroom, & le_dirty + write + nfs , & writeback) |
1624 | le_dirty + write + nfs += writeback |
1634 | Else |
1635 | m_dirty = le_dirty + write + nfs |
1636 | m_thresh = dirty threshold |
1653 | If dirty <= dirty_freerun_ceiling(thresh, bg_thresh) && ( Not mdtc || m_dirty <= dirty_freerun_ceiling(m_thresh, m_bg_thresh) ) Then |
1659 | dirty_paused_when = now |
1660 | nr_dirtied = 0 |
1663 | nr_dirtied_pause = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(intv, m_intv) |
1664 | Break |
1670 | mem_cgroup_flush_foreign(wb) |
1676 | If Not strictlimit Then wb_dirty_limits(gdtc) |
1679 | dirty_exceeded = per-wb counterparts > wb_thresh && ( le_dirty + write + nfs > dirty threshold || strictlimit) |
1685 | If mdtc Then |
1692 | If Not strictlimit Then wb_dirty_limits(mdtc) |
1695 | dirty_exceeded |= per-wb counterparts > wb_thresh && ( le_dirty + write + nfs > dirty threshold || strictlimit) |
1703 | If dirty_exceeded && Not dirty_exceeded Then dirty_exceeded = 1 |
1708 | spin_lock( & protects the b_* lists ) |
1709 | __wb_update_bandwidth(gdtc, mdtc, start_time, true) |
1710 | spin_unlock( & protects the b_* lists ) |
1715 | task_ratelimit = dirty_ratelimit * pos_ratio >> RATELIMIT_CALC_SHIFT |
1717 | max_pause = wb_max_pause(wb, per-wb counterparts ) |
1718 | min_pause = wb_min_pause(wb, max_pause, task_ratelimit, dirty_ratelimit, & nr_dirtied_pause) |
1722 | If Value for the false possibility is greater at compile time(task_ratelimit == 0) Then |
1727 | period = HZ * pages_dirtied / task_ratelimit |
1729 | If dirty_paused_when Then pause -= now - dirty_paused_when |
1752 | dirty_paused_when = now |
1753 | nr_dirtied = 0 |
1754 | Else if period Then |
1755 | dirty_paused_when += period |
1756 | nr_dirtied = 0 |
1757 | Else if nr_dirtied_pause <= pages_dirtied Then nr_dirtied_pause += pages_dirtied |
1759 | Break |
1761 | If Value for the false possibility is greater at compile time(pause > max_pause) Then |
1767 | pause : |
1784 | dirty_paused_when = now + pause |
1785 | nr_dirtied = 0 |
1786 | nr_dirtied_pause = nr_dirtied_pause |
1792 | If task_ratelimit Then Break |
1805 | If per-wb counterparts <= maximal error of a stat counter. Then Break |
1808 | If fatal_signal_pending(current process) Then Break |
1812 | If Not dirty_exceeded && dirty_exceeded Then dirty_exceeded = 0 |
1826 | If Flag that puts the machine in "laptop mode". Doubles as a timeout in jiffies:* a full sync is triggered after this time elapses without any disk activity. Then Return |
Name | Describe |
---|---|
balance_dirty_pages_ratelimited | alance_dirty_pages_ratelimited - balance dirty memory state*@mapping: address_space which was dirtied* Processes which are dirtying memory should call in here once for each page* which was newly dirtied. The function will periodically check the system's |
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 |