Function report |
Source Code:kernel\power\snapshot.c |
Create Date:2022-07-28 10:01:14 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:hibernate_preallocate_memory - Preallocate memory for hibernation image
Proto:int hibernate_preallocate_memory(void)
Type:int
Parameter:Nothing
1703 | pages = 0 |
1708 | pr_info("Preallocating image memory... ") |
1723 | save_highmem = count_highmem_pages() |
1731 | saveable += save_highmem |
1732 | highmem = save_highmem |
1733 | size = 0 |
1734 | do nothing (zone) |
1738 | Else count += zone_page_state(zone, NR_FREE_PAGES) |
1741 | avail_normal = count |
1743 | count -= linux/mm/page_alloc.c |
1746 | size += page_key_additional_pages(saveable) |
1762 | pages += preallocate_image_memory(saveable - pages, avail_normal) |
1763 | Go to out |
1773 | If avail_normal > pages Then avail_normal -= pages |
1775 | Else avail_normal = 0 |
1777 | If size < pages Then size = min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(unsignedlong, pages, max_size) |
1786 | shrink_all_memory(saveable - size) |
1795 | pages_highmem = preallocate_image_highmem(highmem / 2) |
1797 | If alloc > pages_highmem Then alloc -= pages_highmem |
1799 | Else alloc = 0 |
1801 | pages = preallocate_image_memory(alloc, avail_normal) |
1805 | pages += pages_highmem |
1807 | If pages_highmem < alloc Then Go to err_out |
1809 | pages += pages_highmem |
1815 | pages += preallocate_image_highmem(alloc) |
1816 | Else |
1822 | size = preallocate_highmem_fraction(alloc, highmem, count) |
1823 | pages_highmem += size |
1825 | size = preallocate_image_memory(alloc, avail_normal) |
1826 | pages_highmem += preallocate_image_highmem(alloc - size) |
1827 | pages += pages_highmem + size |
1837 | out : |
1839 | Like KERN_CONT, pr_cont() should only be used when continuing* a line with no newline ('\n') enclosed. Otherwise it defaults* back to KERN_DEFAULT.("done (allocated %lu pages)\n", pages) |
1842 | Return 0 |
1844 | err_out : |
1847 | Return -ENOMEM |
Name | Describe |
---|---|
hibernation_snapshot | hibernation_snapshot - Quiesce devices and create a hibernation image.*@platform_mode: If set, use platform driver to prepare for the transition.* This routine must be called with system_transition_mutex held. |
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 |