Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\frontswap.c Create Date:2022-07-28 15:21:34
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Used to check if it's necessory and feasible to unuse pages.* Return 1 when nothing to do, 0 when need to shink pages,* error code when there is an error.

Proto:static int __frontswap_shrink(unsigned long target_pages, unsigned long *pages_to_unuse, int *type)

Type:int

Parameter:

TypeParameterName
unsigned longtarget_pages
unsigned long *pages_to_unuse
int *type
424  total_pages = 0
426  assert_spin_locked( & swap_lock)
428  total_pages = __frontswap_curr_pages()
429  If total_pages <= target_pages Then
431  pages_to_unuse = 0
432  Return 1
434  total_pages_to_unuse = total_pages - target_pages
435  Return __frontswap_unuse_pages(total_pages_to_unuse, pages_to_unuse, type)
Caller
NameDescribe
frontswap_shrinkFrontswap, like a true swap device, may unnecessarily retain pages* under certain circumstances; "shrink" frontswap is essentially a* "partial swapoff" and works by calling try_to_unuse to attempt to* unuse enough frontswap pages to attempt to -- subject