函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\power\snapshot.c Create Date:2022-07-27 11:01:13
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:_unnecessary_pages - Release preallocated pages not needed for the image.

函数原型:static unsigned long free_unnecessary_pages(void)

返回类型:unsigned long

参数:

1603  save等于_data_pages - Compute the total number of saveable non-highmem pages.
1604  如果Numbers of normal and highmem page frames allocated for hibernation image* before suspending devices.大于等于save
1605  to_free_normal等于Numbers of normal and highmem page frames allocated for hibernation image* before suspending devices.save
1606  save等于0
1607  否则
1608  to_free_normal等于0
1609  save减等于Numbers of normal and highmem page frames allocated for hibernation image* before suspending devices.
1611  save加等于count_highmem_pages()
1612  如果Numbers of normal and highmem page frames allocated for hibernation image* before suspending devices.大于等于save
1613  to_free_highmem等于Numbers of normal and highmem page frames allocated for hibernation image* before suspending devices.save
1614  否则
1615  to_free_highmem等于0
1616  save减等于Numbers of normal and highmem page frames allocated for hibernation image* before suspending devices.
1617  如果to_free_normal大于saveto_free_normal减等于save
1619  否则to_free_normal等于0
1622  free等于to_free_normalto_free_highmem
1624  memory_bm_position_reset( & Memory bitmap used during hibernation for marking allocated page frames that* will contain copies of saveable pages. During restore it is initially used* for marking hibernation image pages, but then the set bits from it are)
1626 to_free_normal大于0或to_free_highmem大于0循环
1627  pfn等于memory_bm_rtree_next_pfn - Find the next set bit in a memory bitmap.*@bm: Memory bitmap.* Starting from the last returned position this function searches for the next* set bit in @bm and returns the PFN represented by it. If no more bits are
1628  page等于pfn_to_page(pfn)
1630  如果PageHighMem(page)则
1631  如果非to_free_highmem则继续下一循环
1633  to_free_highmem自减
1635  否则
1636  如果非to_free_normal则继续下一循环
1638  to_free_normal自减
1641  memory_bm_clear_bit( & Memory bitmap used during hibernation for marking allocated page frames that* will contain copies of saveable pages. During restore it is initially used* for marking hibernation image pages, but then the set bits from it are, pfn)
1642  swsusp_unset_page_forbidden(page)
1643  swsusp_unset_page_free(page)
1644  __free_page(page)
1647  返回:free
调用者
名称描述
hibernate_preallocate_memoryhibernate_preallocate_memory - Preallocate memory for hibernation image