Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\swap_slots.c Create Date:2022-07-28 15:20:53
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:drain_slots_cache_cpu

Proto:static void drain_slots_cache_cpu(unsigned int cpu, unsigned int type, bool free_slots)

Type:void

Parameter:

TypeParameterName
unsigned intcpu
unsigned inttype
boolfree_slots
174  swp_entry_t * slots = NULL
176  cache = per_cpu(swp_slots, cpu)
177  If type & SLOTS_CACHE && slots Then
178  mutex_lock( & protects slots, nr, cur )
179  swapcache_free_entries(slots + cur, nr)
180  cur = 0
181  nr = 0
182  If free_slots && slots Then
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  If type & SLOTS_CACHE_RET && slots_ret Then
189  spin_lock_irq( & protects slots_ret, n_ret )
190  swapcache_free_entries(slots_ret, n_ret)
191  n_ret = 0
192  If free_slots && slots_ret Then
193  slots = slots_ret
194  slots_ret = NULL
196  spin_unlock_irq( & protects slots_ret, n_ret )
197  If slots Then kvfree() - 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.
Caller
NameDescribe
__drain_swap_slots_cache
free_slot_cache