Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:poison_memory - Unpoison a previously poisoned page*@pfn: Page number of the to be unpoisoned page* Software-unpoison a page that has been poisoned by* memory_failure() earlier

Proto:int unpoison_memory(unsigned long pfn)

Type:int

Parameter:

TypeParameterName
unsigned longpfn
1523  freeit = 0
1524  DEFINE_RATELIMIT_STATE(unpoison_rs, DEFAULT_RATELIMIT_INTERVAL, DEFAULT_RATELIMIT_BURST)
1527  If Not pfn_valid(pfn) Then Return -ENXIO
1530  p = pfn_to_page(pfn)
1531  page = compound_head(p)
1533  If Not PageHWPoison(p) Then
1534  unpoison_pr_info("Unpoison: Page was already unpoisoned %#lx\n", pfn, & unpoison_rs)
1536  Return 0
1539  If page_count(page) > 1 Then
1540  unpoison_pr_info("Unpoison: Someone grabs the hwpoison page %#lx\n", pfn, & unpoison_rs)
1542  Return 0
1545  If Return true if this page is mapped into pagetables.* For compound page it returns true if any subpage of compound page is mapped. Then
1546  unpoison_pr_info("Unpoison: Someone maps the hwpoison page %#lx\n", pfn, & unpoison_rs)
1548  Return 0
1551  If page_mapping(page) Then
1552  unpoison_pr_info("Unpoison: the hwpoison page has non-NULL mapping %#lx\n", pfn, & unpoison_rs)
1554  Return 0
1562  If Not PageHuge() only returns true for hugetlbfs pages, but not for normal or* transparent huge pages. See the PageTransHuge() documentation for more* details. && 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 Then
1563  unpoison_pr_info("Unpoison: Memory failure is now running on %#lx\n", pfn, & unpoison_rs)
1565  Return 0
1568  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
1569  If TestClearPageHWPoison(p) Then num_poisoned_pages_dec()
1571  unpoison_pr_info("Unpoison: Software-unpoisoned free page %#lx\n", pfn, & unpoison_rs)
1573  Return 0
1576  lock_page may only be called if we have the page's inode pinned.
1583  If TestClearPageHWPoison(page) Then
1584  unpoison_pr_info("Unpoison: Software-unpoisoned page %#lx\n", pfn, & unpoison_rs)
1586  num_poisoned_pages_dec()
1587  freeit = 1
1589  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.
1591  put_hwpoison_page(page)
1592  If freeit && Not ( pfn == my_zero_pfn(0) && page_count(p) == 1 ) Then put_hwpoison_page(page)
1595  Return 0
Caller
NameDescribe
hwpoison_unpoison