函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:swap_cgroup_record - record mem_cgroup for a set of swap entries*@ent: the first swap entry to be recorded into*@id: mem_cgroup to be recorded*@nr_ents: number of swap entries to be recorded* Returns old value at success, 0 at failure.

函数原型:unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id, unsigned int nr_ents)

返回类型:unsigned short

参数:

类型参数名称
swp_entry_tent
unsigned shortid
unsigned intnr_ents
133  offset等于Extract the `offset' field from a swp_entry_t. The swp_entry_t is in* arch-independent format
134  end等于offsetnr_ents
136  sc等于lookup_swap_cgroup(ent, & ctrl)
138  spin_lock_irqsave( & lock, flags)
139  old等于id
140  循环
141  VM_BUG_ON(id != old)
142  id等于id
143  offset自加
144  如果offset恒等于end退出
146  如果offset取模SC_PER_PAGEsc自加
148  否则sc等于__lookup_swap_cgroup(ctrl, offset)
151  spin_unlock_irqrestore( & lock, flags)
153  返回:old
调用者
名称描述
mem_cgroup_try_charge_swapmem_cgroup_try_charge_swap - try charging swap space for a page*@page: page being added to swap*@entry: swap entry to charge* Try to charge @page's memcg for the swap space at @entry.* Returns 0 on success, -ENOMEM on failure.
mem_cgroup_uncharge_swapmem_cgroup_uncharge_swap - uncharge swap space*@entry: swap entry to uncharge*@nr_pages: the amount of swap space to uncharge