Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\power\snapshot.c Create Date:2022-07-28 10:01:19
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:swsusp_save

Proto:asmlinkage __visible int swsusp_save(void)

Type:int

Parameter:Nothing

1979  pr_info("Creating hibernation image:\n")
1981  drain_local_pages(NULL)
1982  nr_pages = _data_pages - Compute the total number of saveable non-highmem pages.
1983  nr_highmem = count_highmem_pages()
1984  pr_info("Need to copy %u pages\n", nr_pages + nr_highmem)
1986  If Not gh_free_mem - Check if there is enough free memory for the image. Then
1987  pr_err("Not enough free memory\n")
1988  Return -ENOMEM
1991  If swsusp_alloc - Allocate memory for hibernation image Then
1992  pr_err("Memory allocation failed\n")
1993  Return -ENOMEM
2000  drain_local_pages(NULL)
2001  copy_data_pages( & 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, & Memory bitmap used for marking saveable pages (during hibernation) or* hibernation image pages (during restore))
2009  nr_pages += nr_highmem
2010  Total number of image pages = nr_pages
2011  Number of pages needed for saving the original pfns of the image pages = DIV_ROUND_UP(nr_pages * sizeof(long), PAGE_SIZE)
2013  pr_info("Hibernation image created (%d pages copied)\n", nr_pages)
2015  Return 0