函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Error injection support for memory error handling.

函数原型:static int madvise_inject_error(int behavior, unsigned long start, unsigned long end)

返回类型:int

参数:

类型参数名称
intbehavior
unsigned longstart
unsigned longend
869  如果非操作权限检查则返回:负EPERM
873 start小于end循环
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  如果ret不等于1则返回:ret
880  pfn等于page_to_pfn(page)
887  size等于Returns the number of bytes in this potentially compound page.
889  如果PageHWPoison(page)则
890  put_page(page)
891  继续下一循环
894  如果behavior恒等于soft offline page for testing
895  打印信息("Soft offlining pfn %#lx at process virtual address %#lx\n", pfn, start)
899  如果ret则返回:ret
901  继续下一循环
904  打印信息("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  如果ret则返回:ret
920 zone循环如果非Returns true if a zone has memory
920  否则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  返回:0
调用者
名称描述
SYSCALL_DEFINE3The madvise(2) system call