函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Do all that is necessary to remove user space mappings. Unmap* the pages and send SIGBUS to the processes if the data was dirty.

函数原型:static bool hwpoison_user_mappings(struct page *p, unsigned long pfn, int flags, struct page **hpagep)

返回类型:bool

参数:

类型参数名称
struct page *p
unsigned longpfn
intflags
struct page **hpagep
954  ttu等于 ignore mlock 按位或 don't age
956  LIST_HEAD(tokill)
958  kill等于1
959  hpage等于hpagep
960  mlocked等于PageMlocked(hpage)
966  如果PageReserved(p)或PageSlab(p)则返回:true
968  如果非PageLRU(hpage)或PageHuge() only returns true for hugetlbfs pages, but not for normal or* transparent huge pages. See the PageTransHuge() documentation for more* details.的值则返回:true
975  如果非Return true if this page is mapped into pagetables.* For compound page it returns true if any subpage of compound page is mapped.则返回:true
978  如果A KSM page is one of those write-protected "shared pages" or "merged pages"* which KSM maps into multiple mms, wherever identical anonymous page content* is found in VM_MERGEABLE vmas. It's a PageAnon page, pointing not to any
979  打印错误信息("Memory failure: %#lx: can't handle KSM pages.\n", pfn)
980  返回:false
983  如果PageSwapCache(p)则
984  打印错误信息("Memory failure: %#lx: keeping poisoned page in swap cache\n", pfn)
986  ttu或等于 corrupted page is recoverable
995  mapping等于page_mapping(hpage)
996  如果非flags按位与MF_MUST_KILL的值且非PageDirty(hpage)且mappingmapping_cap_writeback_dirty(mapping)则
998  如果page_mkclean(hpage)则
1000  否则
1001  kill等于0
1003  打印信息("Memory failure: %#lx: corrupted page was clean: dropped without side effects\n", pfn)
1016  如果killCollect the processes who have the corrupted page mapped to kill.
1019  unmap_success等于ry_to_unmap - try to remove all page table mappings to a page*@page: the page to get unmapped*@flags: action and flags* Tries to remove all the page table entries which are mapping this* page, used in the pageout path. Caller must hold the page lock.
1020  如果非unmap_success打印错误信息("Memory failure: %#lx: failed to unmap page (mapcount=%d)\n", pfn, page_mapcount(hpage))
1028  如果mlockedWhen 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.
1041  forcekill等于PageDirty(hpage)或flags按位与MF_MUST_KILL
1042  Kill the processes that have been collected earlier.* Only do anything when DOIT is set, otherwise just free the list* (this is used for clean pages which do not need killing)* Also when FAIL is set do a force kill because something went* wrong earlier.
1044  返回:unmap_success
调用者
名称描述
memory_failure_hugetlb
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