Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:memory_failure_dev_pagemap

Proto:static int memory_failure_dev_pagemap(unsigned long pfn, int flags, struct dev_pagemap *pgmap)

Type:int

Parameter:

TypeParameterName
unsigned longpfn
intflags
struct dev_pagemap *pgmap
1145  page = pfn_to_page(pfn)
1146  const bool unmap_success = true
1147  size = 0
1149  LIST_HEAD(tokill)
1150  rc = -EBUSY
1161  cookie = dax_lock_page(page)
1162  If Not cookie Then Go to out
1165  If hwpoison_filter(page) Then
1166  rc = 0
1167  Go to unlock
1170  If type == MEMORY_DEVICE_PRIVATE Then
1175  Go to unlock
1182  SetPageHWPoison(page)
1190  flags |= MF_ACTION_REQUIRED | MF_MUST_KILL
1191  Collect the processes who have the corrupted page mapped to kill.
1193  list_for_each_entry - iterate over list of given type*@pos: the type * to use as a loop cursor.*@head: the head for your list.*@member: the name of the list_head within the struct.(tk, & tokill, nd)
1194  If size_shift Then size = max - return maximum of two values of the same or compatible types*@x: first value*@y: second value(size, 1UL << size_shift)
1196  If size Then
1203  start = Our offset within mapping. << PAGE_SHIFT determines the page size & ~(size - 1)
1204  map_mapping_range - unmap the portion of all mmaps in the specified* address_space corresponding to the specified byte range in the underlying* file
1206  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.
1207  rc = 0
1208  unlock :
1209  dax_unlock_page(page, cookie)
1210  out :
1212  put_dev_pagemap(pgmap)
1213  "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().
1214  Return rc
Caller
NameDescribe
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