函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Drains all per-CPU charge caches for given root_memcg resp. subtree* of the hierarchy under it.

函数原型:static void drain_all_stock(struct mem_cgroup *root_memcg)

返回类型:void

参数:

类型参数名称
struct mem_cgroup *root_memcg
2145  如果非mutex_trylock - try to acquire the mutex, without waiting*@lock: the mutex to be acquired* Try to acquire the mutex atomically则返回
2153  curcpu等于get_cpu()
2154  遍历在线CPU(cpu)
2155  stock等于per_cpu(memcg_stock, cpu)
2157  bool flush = false
2159  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
2160  memcg等于 this never be root cgroup
2161  如果memcgnr_pagesmem_cgroup_is_descendant(memcg, root_memcg)则flush = true
2164  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
2168  如果cpu恒等于curcpudrain_local_stock( & work)
2170  否则为cpu配置任务
2174  put_cpu()
2175  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.
调用者
名称描述
try_charge
mem_cgroup_resize_max
mem_cgroup_force_emptyReclaims as many pages from the given memcg as possible.* Caller is responsible for holding css reference for memcg.
mem_cgroup_css_offline
memory_high_write
memory_max_write