Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:hwpoison_inject

Proto:static int hwpoison_inject(void *data, u64 val)

Type:int

Parameter:

TypeParameterName
void *data
u64val
16  pfn = val
21  If Not Check operation authority Then Return -EPERM
24  If Not pfn_valid(pfn) Then Return -ENXIO
27  p = pfn_to_page(pfn)
28  hpage = compound_head(p)
32  If 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 Return 0
35  If Not hwpoison_filter_enable Then Go to inject
38  When a unknown page type is encountered drain as many buffers as possible* in the hope to turn the page into a LRU or free page, which we can handle.
42  If Not PageLRU(hpage) && Not PageHuge() only returns true for hugetlbfs pages, but not for normal or* transparent huge pages. See the PageTransHuge() documentation for more* details. Then Go to put_out
50  err = hwpoison_filter(hpage)
51  If err Then Go to put_out
54  inject :
55  pr_info("Injecting memory failure at pfn %#lx\n", pfn)
56  Return memory_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
57  put_out :
58  put_hwpoison_page(p)
59  Return 0