函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\memory-failure.c Create Date:2022-07-27 17:54:10
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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

函数原型:int memory_failure(unsigned long pfn, int flags)

返回类型:int

参数:

类型参数名称
unsigned longpfn
intflags
1243  如果非sysctl_memory_failure_recoverypanic - halt the system*@fmt: The text string to print* Display a message, then perform cleanups.* This function never returns.
1246  p等于Return page for the valid pfn only if the page is online. All pfn* walkers which rely on the fully initialized page->flags and others* should use this rather than pfn_valid && pfn_to_page(pfn)
1247  如果非p
1248  如果pfn_valid(pfn)则
1249  pgmap等于get_dev_pagemap(pfn, NULL)
1250  如果pgmap则返回:memory_failure_dev_pagemap(pfn, flags, pgmap)
1254  打印错误信息("Memory failure: %#lx: memory outside kernel control\n", pfn)
1256  返回:负ENXIO
1259  如果PageHuge() only returns true for hugetlbfs pages, but not for normal or* transparent huge pages. See the PageTransHuge() documentation for more* details.则返回:memory_failure_hugetlb(pfn, flags)
1261  如果TestSetPageHWPoison(p)则
1262  打印错误信息("Memory failure: %#lx: already hardware poisoned\n", pfn)
1264  返回:0
1267  orig_head等于hpage等于compound_head(p)
1268  num_poisoned_pages_inc()
1281  如果非flags按位与MF_COUNT_INCREASED的值且非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.)
1282  如果is_free_buddy_page(p)则
1284  返回:0
1285  否则
1287  返回:负EBUSY
1291  如果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
1292  lock_page may only be called if we have the page's inode pinned.
1295  如果非PageAnon(p)则打印错误信息("Memory failure: %#lx: non anonymous thp\n", pfn)
1298  否则打印错误信息("Memory failure: %#lx: thp split failed\n", pfn)
1304  返回:负EBUSY
1306  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.
1307  VM_BUG_ON_PAGE(!page_count(p), p)
1308  hpage等于compound_head(p)
1319  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.
1321  如果非PageLRU(p)且is_free_buddy_page(p)则
1322  如果flags按位与MF_COUNT_INCREASED"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().
1324  否则"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().
1326  返回:0
1329  lock_page may only be called if we have the page's inode pinned.
1335  如果PageCompound(p)且compound_head(p)不等于orig_head
1336  "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().
1337  res等于负EBUSY
1338  转到:out
1348  如果PageHuge() only returns true for hugetlbfs pages, but not for normal or* transparent huge pages. See the PageTransHuge() documentation for more* details.page_flags等于体系结构无关页的属性
1350  否则page_flags等于体系结构无关页的属性
1356  如果非PageHWPoison(p)则
1357  打印错误信息("Memory failure: %#lx: just unpoisoned\n", pfn)
1358  num_poisoned_pages_dec()
1359  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.
1360  put_hwpoison_page(p)
1361  返回:0
1363  如果hwpoison_filter(p)则
1364  如果TestClearPageHWPoison(p)则num_poisoned_pages_dec()
1366  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.
1367  put_hwpoison_page(p)
1368  返回:0
1371  如果非PageTransTail returns true for both transparent huge pages* and hugetlbfs pages, so it should only be called when it's known* that hugetlbfs pages aren't involved.且非PageLRU(p)则转到:identify_page_state
1378  Wait for a page to complete writeback
1387  如果非Do all that is necessary to remove user space mappings. Unmap* the pages and send SIGBUS to the processes if the data was dirty.
1388  "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().
1389  res等于负EBUSY
1390  转到:out
1396  如果(PageLRU(p) && !PageSwapCache(p) && See page-flags.h for PAGE_MAPPING_FLAGS == NULL)则
1397  "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().
1398  res等于负EBUSY
1399  转到:out
1402  identify_page_state :
1403  res等于identify_page_state(pfn, p, page_flags)
1404  out :
1405  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.
1406  返回:res
调用者
名称描述
do_memory_failure
memory_failure_work_func
hwpoison_inject
srao_decode_notifier
madvise_inject_errorError injection support for memory error handling.