Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\slab.c Create Date:2022-07-28 15:46:19
Last Modify:2022-05-23 17:02:55 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:ache_reap - Reclaim memory from caches

Proto:static void cache_reap(struct work_struct *w)

Type:void

Parameter:

TypeParameterName
struct work_struct *w
4032  node = Returns the number of the nearest Node with memory
4033  work = to_delayed_work(w)
4035  If Not mutex_trylock - try to acquire the mutex, without waiting*@lock: the mutex to be acquired* Try to acquire the mutex atomically Then Go to out
4040  check_irq_on()
4047  n = get_node(searchp, node)
4049  Called from cache_reap() to regularly drain alien caches round robin.
4051  Drain an array if it contains any elements taking the node lock only if* necessary. Note that the node listlock also protects the array_cache* if drain_array() is used on the shared array.
4057  If These inlines deal with timer wrapping correctly. You are * strongly encouraged to use them* 1. Because people otherwise forget* 2. Because if the timer wrap changes in future you won't have to* alter your driver code.(next_reap, jiffies) Then Go to next
4060  next_reap = jiffies + REAPTIMEOUT_NODE
4062  Drain an array if it contains any elements taking the node lock only if* necessary. Note that the node listlock also protects the array_cache* if drain_array() is used on the shared array.
4064  If free_touched Then free_touched = 0
4066  Else
4069  freed = drain_freelist(searchp, n, (free_limit + 5 * num - 1) / (5 * num))
4071  STATS_ADD_REAPED(searchp, freed)
4073  :
4074  cond_resched()
4076  check_irq_on()
4077  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.
4078  next_reap_node()
4079  out :
4081  schedule_delayed_work_on - queue work in global workqueue on CPU after delay*@cpu: cpu to use*@dwork: job to be done*@delay: number of jiffies to wait* After waiting for a given time this puts a job in the kernel-global* workqueue on the specified CPU.