Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__frontswap_unuse_pages

Proto:static int __frontswap_unuse_pages(unsigned long total, unsigned long *unused, int *swapid)

Type:int

Parameter:

TypeParameterName
unsigned longtotal
unsigned long *unused
int *swapid
385  ret = -EINVAL
386  struct swap_info_struct * si = NULL
388  total_pages_to_unuse = total
389  pages = 0 , pages_to_unuse = 0
391  assert_spin_locked( & swap_lock)
392  plist_for_each_entry - iterate over list of given type*@pos: the type * to use as a loop counter*@head: the head for your list*@mem: the name of the list_head within the struct(si, & all active swap_info_structs* protected with swap_lock, and ordered by priority., list)
393  si_frontswap_pages = atomic_read( & swap pages in-use counter )
396  Else
398  pages_to_unuse = 0
402  ret = -ENOMEM
403  Continue
405  vm_unacct_memory(pages)
406  unused = pages_to_unuse
407  swapid = strange name for an index
408  ret = 0
409  Break
412  Return ret
Caller
NameDescribe
__frontswap_shrinkUsed 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.