函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:get_mem_cgroup_from_mm: Obtain a reference on given mm_struct's memcg.*@mm: mm from which memcg should be extracted. It can be NULL.* Obtain a reference on mm->memcg and returns it if successful. Otherwise* root_mem_cgroup is returned

函数原型:struct mem_cgroup *get_mem_cgroup_from_mm(struct mm_struct *mm)

返回类型:struct mem_cgroup

参数:

类型参数名称
struct mm_struct *mm
927  如果mem_cgroup_disabled()则返回:NULL
930  _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
931  循环
937  如果此条件成立可能性小(为编译器优化)(!mm)则memcg等于root_mem_cgroup
939  否则
944  当非ss_tryget - try to obtain a reference on the specified css*@css: target css* Obtain a reference on @css unless it already has reached zero and is* being released. This function doesn't care whether @css is on or* offline循环
945  _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()
946  返回:memcg
调用者
名称描述
get_mem_cgroup_from_currentIf current->active_memcg is non-NULL, do not fallback to current->mm->memcg.
mem_cgroup_handle_over_highScheduled by try_charge() to be executed from the userland return path* and reclaims memory over the high limit.
mem_cgroup_try_chargemem_cgroup_try_charge - try charging a page*@page: page to charge*@mm: mm context of the victim*@gfp_mask: reclaim mode*@memcgp: charged memcg return*@compound: charge the page as compound or small page* Try to charge @page to the memcg that @mm belongs
SYSCALL_DEFINE2anotify syscalls
inotify_new_group