函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__swap_entry_free_locked

函数原型:static unsigned char __swap_entry_free_locked(struct swap_info_struct *p, unsigned long offset, unsigned char usage)

返回类型:unsigned char

参数:

类型参数名称
struct swap_info_struct *p
unsigned longoffset
unsigned charusage
1184  count等于vmalloc'ed array of usage counts [offset]
1186  has_cache等于count按位与Flag page is cached, in first swap_map
1187  count与等于Flag page is cached, in first swap_map 的反
1189  如果usage恒等于Flag page is cached, in first swap_map
1190  VM_BUG_ON(!has_cache)
1191  has_cache等于0
1192  否则如果count恒等于Owned by shmem/tmpfs, in first swap_map
1197  count等于0
1198  否则如果count按位与See swap_map continuation for full count 的反的值小于等于Max duplication count, in first swap_map
1204  否则count自减
1208  usage等于count按位或has_cache
1209  vmalloc'ed array of usage counts [offset]等于如果usage否则Flag page is cached, in first swap_map
1211  返回:usage
调用者
名称描述
__swap_entry_free
put_swap_pageCalled after dropping swapcache to decrease refcnt to swap entries.