Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:mem_cgroup_swapout - transfer a memsw charge to swap*@page: page whose memsw charge to transfer*@entry: swap entry to move the charge to* Transfer the memsw charge of @page to @entry.

Proto:void mem_cgroup_swapout(struct page *page, swp_entry_t entry)

Type:void

Parameter:

TypeParameterName
struct page *page
swp_entry_tentry
6866  VM_BUG_ON_PAGE(PageLRU(page), page)
6867  VM_BUG_ON_PAGE(page_count(page), page)
6869  If Not Whether legacy memory+swap accounting is active Then Return
6872  memcg = mem_cgroup
6875  If Not memcg Then Return
6883  swap_memcg = mem_cgroup_id_get_online(memcg)
6884  nr_entries = hpage_nr_pages(page)
6886  If nr_entries > 1 Then mem_cgroup_id_get_many(swap_memcg, nr_entries - 1)
6888  oldid = swap_cgroup_record(entry, mem_cgroup_id(swap_memcg), nr_entries)
6890  VM_BUG_ON_PAGE(oldid, page)
6891  dx can be of type enum memcg_stat_item or node_stat_item
6893  mem_cgroup = NULL
6895  If Not mem_cgroup_is_root(memcg) Then page_counter_uncharge - hierarchically uncharge pages*@counter: counter*@nr_pages: number of pages to uncharge
6898  If memcg != swap_memcg Then
6899  If Not mem_cgroup_is_root(swap_memcg) Then page_counter_charge - hierarchically charge pages*@counter: counter*@nr_pages: number of pages to charge* NOTE: This does not consider any configured counter limits.
6901  page_counter_uncharge - hierarchically uncharge pages*@counter: counter*@nr_pages: number of pages to uncharge
6910  VM_BUG_ON(!Some architectures don't define arch_irqs_disabled(), so even if either* definition would be fine we need to use different ones for the time being* to avoid build issues.())
6911  mem_cgroup_charge_statistics(memcg, page, 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, - nr_entries)
6913  Check events in order.
6915  If Not mem_cgroup_is_root(memcg) Then ss_put_many - put css references*@css: target css*@n: number of references to put* Put references obtained via css_get() and css_tryget_online().