函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:drain_slots_cache_cpu

函数原型:static void drain_slots_cache_cpu(unsigned int cpu, unsigned int type, bool free_slots)

返回类型:void

参数:

类型参数名称
unsigned intcpu
unsigned inttype
boolfree_slots
174  swp_entry_t * slots = NULL
176  cache等于per_cpu(swp_slots, cpu)
177  如果type按位与SLOTS_CACHEslots
178  mutex_lock( & protects slots, nr, cur )
179  swapcache_free_entries(slots + cur, nr)
180  cur等于0
181  nr等于0
182  如果free_slotsslots
184  slots = NULL
186  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
188  如果type按位与SLOTS_CACHE_RETslots_ret
189  spin_lock_irq( & protects slots_ret, n_ret )
190  swapcache_free_entries(slots_ret, n_ret)
191  n_ret等于0
192  如果free_slotsslots_ret
193  slots等于slots_ret
194  slots_ret = NULL
196  spin_unlock_irq( & protects slots_ret, n_ret )
197  如果slotskvfree() - Free memory.*@addr: Pointer to allocated memory.* kvfree frees memory allocated by any of vmalloc(), kmalloc() or kvmalloc().* It is slightly more efficient to use kfree() or vfree() if you are certain* that you know which one to use.
调用者
名称描述
__drain_swap_slots_cache
free_slot_cache