Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:mem_cgroup_move_account - move account of the page*@page: the page*@compound: charge the page as compound or small page*@from: mem_cgroup which the page is moved from.*@to: mem_cgroup which the page is moved to. @from != @to.

Proto:static int mem_cgroup_move_account(struct page *page, bool compound, struct mem_cgroup *from, struct mem_cgroup *to)

Type:int

Parameter:

TypeParameterName
struct page *page
boolcompound
struct mem_cgroup *from
struct mem_cgroup *to
5293  nr_pages = If compound Then hpage_nr_pages(page) Else 1
5297  VM_BUG_ON(from == to)
5298  VM_BUG_ON_PAGE(PageLRU(page), page)
5299  VM_BUG_ON(compound && !PageHuge() only returns true for hugetlbfs pages, but not for* normal or transparent huge pages.* PageTransHuge() returns true for both transparent huge and* hugetlbfs pages, but not normal pages. PageTransHuge() can only be)
5305  ret = -EBUSY
5306  If Not Return true if the page was successfully locked Then Go to out
5309  ret = -EINVAL
5310  If mem_cgroup != from Then Go to out_unlock
5313  anon = PageAnon(page)
5315  pgdat = page_pgdat(page)
5316  from_vec = mem_cgroup_lruvec - get the lru list vector for a memcg & node*@memcg: memcg of the wanted lruvec* Returns the lru list vector holding pages for a given @memcg &*@node combination. This can be the node lruvec, if the memory* controller is disabled.
5317  to_vec = mem_cgroup_lruvec - get the lru list vector for a memcg & node*@memcg: memcg of the wanted lruvec* Returns the lru list vector holding pages for a given @memcg &*@node combination. This can be the node lruvec, if the memory* controller is disabled.
5319  spin_lock_irqsave( & taken only while moving_account > 0 , flags)
5321  If Not anon && Return true if this page is mapped into pagetables.* For compound page it returns true if any subpage of compound page is mapped. Then
5322  __mod_lruvec_state - update lruvec memory statistics*@lruvec: the lruvec*@idx: the stat item*@val: delta to add to the counter, can be negative* The lruvec is the intersection of the NUMA node and a cgroup
5323  __mod_lruvec_state - update lruvec memory statistics*@lruvec: the lruvec*@idx: the stat item*@val: delta to add to the counter, can be negative* The lruvec is the intersection of the NUMA node and a cgroup
5331  If Not anon && PageDirty(page) Then
5332  mapping = page_mapping(page)
5340  If Only test-and-set exist for PG_writeback. The unconditional operators are* risky: they bypass page accounting. Then
5341  __mod_lruvec_state - update lruvec memory statistics*@lruvec: the lruvec*@idx: the stat item*@val: delta to add to the counter, can be negative* The lruvec is the intersection of the NUMA node and a cgroup
5342  __mod_lruvec_state - update lruvec memory statistics*@lruvec: the lruvec*@idx: the stat item*@val: delta to add to the counter, can be negative* The lruvec is the intersection of the NUMA node and a cgroup
5352  mem_cgroup = to
5354  spin_unlock_irqrestore( & taken only while moving_account > 0 , flags)
5356  ret = 0
5358  local_irq_disable()
5359  mem_cgroup_charge_statistics(to, page, compound, nr_pages)
5360  Check events in order.
5361  mem_cgroup_charge_statistics(from, page, compound, - nr_pages)
5362  Check events in order.
5363  The local_irq_*() APIs are equal to the raw_local_irq*()* if !TRACE_IRQFLAGS.()
5364  out_unlock :
5365  lock_page - unlock a locked page*@page: the page* Unlocks the page and wakes up sleepers in ___wait_on_page_locked().* Also wakes sleepers in wait_on_page_writeback() because the wakeup* mechanism between PageLocked pages and PageWriteback pages is shared.
5366  out :
5367  Return ret
Caller
NameDescribe
mem_cgroup_move_charge_pte_range