Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__split_huge_page

Proto:static void __split_huge_page(struct page *page, struct list_head *list, unsigned long end, unsigned long flags)

Type:void

Parameter:

TypeParameterName
struct page *page
struct list_head *list
unsigned longend
unsigned longflags
2502  head = compound_head(page)
2503  pgdat = page_pgdat(head)
2505  struct address_space * swap_cache = NULL
2506  offset = 0
2509  lruvec = mem_cgroup_page_lruvec(head, pgdat)
2512  mem_cgroup_split_huge_fixup(head)
2514  If PageAnon(head) && PageSwapCache(head) Then
2515  swp_entry_t entry = {val = page_private(head)}
2517  offset = Extract the `offset' field from a swp_entry_t. The swp_entry_t is in* arch-independent format
2518  swap_cache = swap_address_space(entry)
2519  xa_lock( & i_pages)
2522  When i >= 1 cycle
2523  __split_huge_page_tail(head, i, lruvec, list)
2526  ClearPageDirty(head + i)
2531  Else if Not PageAnon(page) Then
2534  Else if swap_cache Then
2540  ClearPageCompound(head)
2542  split_page_owner(head, HPAGE_PMD_ORDER)
2545  If PageAnon(head) Then
2547  If PageSwapCache(head) Then
2548  page_ref_add(head, 2)
2549  xa_unlock( & i_pages)
2550  Else
2551  page_ref_inc(head)
2553  Else
2555  page_ref_add(head, 2)
2556  xa_unlock( & i_pages)
2559  spin_unlock_irqrestore( & Write-intensive fields used by page reclaim , flags)
2561  remap_page(head)
2563  When i < HPAGE_PMD_NR cycle
2564  subpage = head + i
2565  If subpage == page Then Continue
2567  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.
2576  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
Caller
NameDescribe
split_huge_page_to_listThis function splits huge page into normal pages. @page can point to any* subpage of huge page to split. Split doesn't change the position of @page.* Only caller must hold pin on the @page, otherwise split fails with -EBUSY.* The huge page must be locked.