Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\swapfile.c Create Date:2022-07-28 15:17:27
Last Modify:2020-03-17 22:19:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__swap_entry_free_locked

Proto:static unsigned char __swap_entry_free_locked(struct swap_info_struct *p, unsigned long offset, unsigned char usage)

Type:unsigned char

Parameter:

TypeParameterName
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  If usage == Flag page is cached, in first swap_map Then
1190  VM_BUG_ON(!has_cache)
1191  has_cache = 0
1192  Else if count == Owned by shmem/tmpfs, in first swap_map Then
1197  count = 0
1198  Else if (count & ~See swap_map continuation for full count ) <= Max duplication count, in first swap_map Then
1204  Else count--
1208  usage = count | has_cache
1209  vmalloc'ed array of usage counts [offset] = If usage Else Flag page is cached, in first swap_map
1211  Return usage
Caller
NameDescribe
__swap_entry_free
put_swap_pageCalled after dropping swapcache to decrease refcnt to swap entries.