Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:gh_free_mem - Check if there is enough free memory for the image.

Proto:static int enough_free_mem(unsigned int nr_pages, unsigned int nr_highmem)

Type:int

Parameter:

TypeParameterName
unsigned intnr_pages
unsigned intnr_highmem
1878  free = Numbers of normal and highmem page frames allocated for hibernation image* before suspending devices.
1880  When zone cycle If Not Returns true if a zone has memory Then
1880  Else If Not s_highmem - helper function to quickly check if a struct zone is a* highmem zone or not. This is an attempt to keep references* to ZONE_{DMA/NORMAL/HIGHMEM/etc} in general code to a minimum.*@zone - pointer to struct zone variable Then
1882  free += zone_page_state(zone, NR_FREE_PAGES)
1884  nr_pages += count_pages_for_highmem(nr_highmem)
1885  pr_debug("Normal pages needed: %u + %u, available pages: %u\n", nr_pages, PAGES_FOR_IO, free)
1888  Return free > nr_pages + PAGES_FOR_IO
Caller
NameDescribe
swsusp_save