函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Try to get a swap entry from current cpu's swap entry pool (a cluster). This* might involve allocating a new cluster for current CPU too.

函数原型:static bool scan_swap_map_try_ssd_cluster(struct swap_info_struct *si, unsigned long *offset, unsigned long *scan_base)

返回类型:bool

参数:

类型参数名称
struct swap_info_struct *si
unsigned long *offset
unsigned long *scan_base
607  new_cluster :
608  cluster等于this_cpu_ptr(per cpu's swap location )
609  如果cluster_is_null( & Current cluster index )则
610  如果非cluster_list_empty( & clusters list )则
614  否则如果非cluster_list_empty( & discard clusters list )则
621  转到:new_cluster
622  否则返回:false
626  found_free = false
632  tmp等于Likely next allocation offset
633  max等于min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(unsignedlong, xtent of the swap_map , (cluster_next( & Current cluster index ) + 1) * SWAPFILE_CLUSTER)
635  如果tmp大于等于max
636  cluster_set_null( & Current cluster index )
637  转到:new_cluster
639  ci等于lock_cluster(si, tmp)
640 tmp小于max循环
642  found_free = true
643  退出
645  tmp自加
647  unlock_cluster(ci)
648  如果非found_free
649  cluster_set_null( & Current cluster index )
650  转到:new_cluster
652  Likely next allocation offset 等于tmp加1
653  offset等于tmp
654  scan_base等于tmp
655  返回:found_free
调用者
名称描述
scan_swap_map_slots