Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Error injection support for memory error handling.

Proto:static int madvise_inject_error(int behavior, unsigned long start, unsigned long end)

Type:int

Parameter:

TypeParameterName
intbehavior
unsigned longstart
unsigned longend
869  If Not Check operation authority Then Return -EPERM
873  When start < end cycle
877  ret = get_user_pages_fast() - pin user pages in memory*@start: starting user address*@nr_pages: number of pages from start to pin*@gup_flags: flags modifying pin behaviour*@pages: array that receives pointers to the pages pinned.
878  If ret != 1 Then Return ret
880  pfn = page_to_pfn(page)
887  size = Returns the number of bytes in this potentially compound page.
889  If PageHWPoison(page) Then
890  put_page(page)
891  Continue
895  pr_info("Soft offlining pfn %#lx at process virtual address %#lx\n", pfn, start)
899  If ret Then Return ret
901  Continue
904  pr_info("Injecting memory failure for pfn %#lx at process virtual address %#lx\n", pfn, start)
913  put_page(page)
914  ret = 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
915  If ret Then Return ret
920  When zone cycle If Not Returns true if a zone has memory Then
920  Else Spill all the per-cpu pages from all CPUs back into the buddy allocator.* When zone parameter is non-NULL, spill just the single zone's pages.* Note that this can be extremely slow as the draining happens in a workqueue.
923  Return 0
Caller
NameDescribe
SYSCALL_DEFINE3The madvise(2) system call