Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:memory_failure_hugetlb

Proto:static int memory_failure_hugetlb(unsigned long pfn, int flags)

Type:int

Parameter:

TypeParameterName
unsigned longpfn
intflags
1072  p = pfn_to_page(pfn)
1073  head = compound_head(p)
1077  If TestSetPageHWPoison(head) Then
1078  pr_err("Memory failure: %#lx: already hardware poisoned\n", pfn)
1080  Return 0
1083  num_poisoned_pages_inc()
1085  If Not (flags & MF_COUNT_INCREASED) && Not get_hwpoison_page() - Get refcount for memory error handling:*@page: raw error page (hit by memory error)* Return: return 0 if failed to grab the refcount, otherwise true (some* non-zero value.) Then
1089  lock_page may only be called if we have the page's inode pinned.
1090  If PageHWPoison(head) Then
1098  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.
1099  Dissolve a given free hugepage into free buddy pages. This function does* nothing for in-use hugepages and non-hugepages.* This function returns values like below:* -EBUSY: failed to dissolved free hugepages or the hugepage is in-use
1100  "Dirty/Clean" indication is not 100% accurate due to the possibility of* setting PG_dirty outside page lock. See also comment above set_page_dirty().
1101  Return 0
1104  lock_page may only be called if we have the page's inode pinned.
1105  page_flags = Atomic flags, some possibly * updated asynchronously
1107  If Not PageHWPoison(head) Then
1108  pr_err("Memory failure: %#lx: just unpoisoned\n", pfn)
1109  num_poisoned_pages_dec()
1110  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.
1111  put_hwpoison_page(head)
1112  Return 0
1124  If huge_page_size(page_hstate(head)) > PMD_SIZE Then
1125  "Dirty/Clean" indication is not 100% accurate due to the possibility of* setting PG_dirty outside page lock. See also comment above set_page_dirty().
1126  res = -EBUSY
1127  Go to out
1130  If Not Do all that is necessary to remove user space mappings. Unmap* the pages and send SIGBUS to the processes if the data was dirty. Then
1131  "Dirty/Clean" indication is not 100% accurate due to the possibility of* setting PG_dirty outside page lock. See also comment above set_page_dirty().
1132  res = -EBUSY
1133  Go to out
1136  res = identify_page_state(pfn, p, page_flags)
1137  out :
1138  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.
1139  Return res
Caller
NameDescribe
memory_failurememory_failure - Handle memory failure of a page.*@pfn: Page Number of the corrupted page*@flags: fine tune action taken* This function is called by the low level machine check code* of an architecture when it detects hardware memory corruption* of a page