Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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.

Proto:unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id, unsigned int nr_ents)

Type:unsigned short

Parameter:

TypeParameterName
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 = offset + nr_ents
136  sc = lookup_swap_cgroup(ent, & ctrl)
138  spin_lock_irqsave( & lock, flags)
139  old = id
140  cycle
141  VM_BUG_ON(id != old)
142  id = id
143  offset++
144  If offset == end Then Break
146  If offset % SC_PER_PAGE Then sc++
148  Else sc = __lookup_swap_cgroup(ctrl, offset)
151  spin_unlock_irqrestore( & lock, flags)
153  Return old
Caller
NameDescribe
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