函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\swapfile.c Create Date:2022-07-27 16:50:45
Last Modify:2020-03-17 22:19:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:add_swap_count_continuation - called when a swap count is duplicated* beyond SWAP_MAP_MAX, it allocates a new page and links that to the entry's* page of the original vmalloc'ed swap_map, to hold the continuation count

函数原型:int add_swap_count_continuation(swp_entry_t entry, gfp_t gfp_mask)

返回类型:int

参数:

类型参数名称
swp_entry_tentry
gfp_tgfp_mask
3538  ret等于0
3544  page等于alloc_page(gfp_mask | __GFP_HIGHMEM)
3546  si等于Check whether swap entry is valid in the swap device
3547  如果非si
3552  转到:outer
3554  加自旋锁
3556  offset等于Extract the `offset' field from a swp_entry_t. The swp_entry_t is in* arch-independent format
3558  ci等于lock_cluster(si, offset)
3560  count等于vmalloc'ed array of usage counts [offset]按位与Flag page is cached, in first swap_map 的反
3562  如果count按位与See swap_map continuation for full count 的反的值不等于Max duplication count, in first swap_map
3568  转到:out
3571  如果非page
3572  ret等于负ENOMEM
3573  转到:out
3581  head等于Walk a vmap address to the struct page it maps.
3582  offset与等于PAGE_MASK的反
3584  加自旋锁
3589  如果非page_private(head)则
3590  BUG_ON(count & See swap_map continuation for full count )
3591  初始化链表头
3592  set_page_private(head, SWP_CONTINUED)
3593  SWP_USED etc: see above 或等于SWP_CONTINUED
3603  如果非count按位与See swap_map continuation for full count 的值则转到:out_unlock_cont
3606  map等于kmap_atomic(list_page)加offset
3607  count等于map
3608  Prevent people trying to call kunmap_atomic() as if it were kunmap()* kunmap_atomic() should get the return value of kmap_atomic, not the page.(map)
3614  如果count按位与See swap_map continuation for full count 的反的值不等于Max count, in each swap_map continuation 则转到:out_unlock_cont
3618  添加链表项
3619  page = NULL
3620  out_unlock_cont :
3621  自旋锁解锁
3622  out :
3623  unlock_cluster(ci)
3624  自旋锁解锁
3625  put_swap_device(si)
3626  outer :
3627  如果page__free_page(page)
3629  返回:ret
调用者
名称描述
swap_duplicateIncrease reference count of swap entry by 1