Lines Matching refs:pfn

236 static int kill_proc(struct to_kill *tk, unsigned long pfn, int flags)
243 pfn, t->comm, t->pid);
385 unsigned long pfn, int flags)
398 pfn, tk->tsk->comm, tk->tsk->pid);
409 else if (kill_proc(tk, pfn, flags) < 0)
411 pfn, tk->tsk->comm, tk->tsk->pid);
620 static int truncate_error_page(struct page *p, unsigned long pfn,
630 pfn, err);
634 pfn);
647 pfn);
658 static int me_kernel(struct page *p, unsigned long pfn)
666 static int me_unknown(struct page *p, unsigned long pfn)
668 pr_err("Memory failure: %#lx: Unknown page state\n", pfn);
675 static int me_pagecache_clean(struct page *p, unsigned long pfn)
708 return truncate_error_page(p, pfn, mapping);
716 static int me_pagecache_dirty(struct page *p, unsigned long pfn)
760 return me_pagecache_clean(p, pfn);
782 static int me_swapcache_dirty(struct page *p, unsigned long pfn)
794 static int me_swapcache_clean(struct page *p, unsigned long pfn)
810 static int me_huge_page(struct page *p, unsigned long pfn)
821 res = truncate_error_page(hpage, pfn, mapping);
865 int (*action)(struct page *p, unsigned long pfn);
913 static void action_result(unsigned long pfn, enum mf_action_page_type type,
916 trace_memory_failure_event(pfn, type, result);
919 pfn, action_page_types[type], action_name[result]);
923 unsigned long pfn)
928 result = ps->action(p, pfn);
935 pfn, action_page_types[ps->type], count);
938 action_result(pfn, ps->type, result);
989 static bool hwpoison_user_mappings(struct page *p, unsigned long pfn,
1017 pr_err("Memory failure: %#lx: can't handle KSM pages.\n", pfn);
1023 pfn);
1042 pfn);
1074 pr_info("Memory failure: %#lx: could not lock mapping for mapped huge page\n", pfn);
1083 pfn, page_mapcount(p));
1103 kill_procs(&tokill, forcekill, !unmap_success, pfn, flags);
1108 static int identify_page_state(unsigned long pfn, struct page *p,
1128 return page_action(ps, p, pfn);
1135 unsigned long pfn = page_to_pfn(page);
1139 pr_info("%s: %#lx: non anonymous thp\n", msg, pfn);
1141 pr_info("%s: %#lx: thp split failed\n", msg, pfn);
1150 static int memory_failure_hugetlb(unsigned long pfn, int flags)
1152 struct page *p = pfn_to_page(pfn);
1159 pfn);
1180 action_result(pfn, MF_MSG_FREE_HUGE, MF_DELAYED);
1188 pr_err("Memory failure: %#lx: just unpoisoned\n", pfn);
1205 action_result(pfn, MF_MSG_NON_PMD_HUGE, MF_IGNORED);
1210 if (!hwpoison_user_mappings(p, pfn, flags, &head)) {
1211 action_result(pfn, MF_MSG_UNMAP_FAILED, MF_IGNORED);
1216 res = identify_page_state(pfn, p, page_flags);
1222 static int memory_failure_dev_pagemap(unsigned long pfn, int flags,
1225 struct page *page = pfn_to_page(pfn);
1241 if (!pgmap_pfn_valid(pgmap, pfn)) {
1250 * also prevents changes to the mapping of this pfn until
1298 kill_procs(&tokill, flags & MF_MUST_KILL, !unmap_success, pfn, flags);
1305 action_result(pfn, MF_MSG_DAX, rc ? MF_FAILED : MF_RECOVERED);
1311 * @pfn: Page Number of the corrupted page
1326 int memory_failure(unsigned long pfn, int flags)
1337 panic("Memory failure on page %lx", pfn);
1339 p = pfn_to_online_page(pfn);
1341 if (pfn_valid(pfn)) {
1342 pgmap = get_dev_pagemap(pfn, NULL);
1344 return memory_failure_dev_pagemap(pfn, flags,
1348 pfn);
1355 res = memory_failure_hugetlb(pfn, flags);
1361 pfn);
1382 action_result(pfn, MF_MSG_BUDDY, MF_DELAYED);
1384 action_result(pfn, MF_MSG_KERNEL_HIGH_ORDER, MF_IGNORED);
1392 action_result(pfn, MF_MSG_UNSPLIT_THP, MF_IGNORED);
1411 action_result(pfn, MF_MSG_BUDDY, MF_DELAYED);
1413 action_result(pfn, MF_MSG_BUDDY_2ND, MF_DELAYED);
1424 action_result(pfn, MF_MSG_DIFFERENT_COMPOUND, MF_IGNORED);
1442 pr_err("Memory failure: %#lx: just unpoisoned\n", pfn);
1474 if (!hwpoison_user_mappings(p, pfn, flags, &p)) {
1475 action_result(pfn, MF_MSG_UNMAP_FAILED, MF_IGNORED);
1484 action_result(pfn, MF_MSG_TRUNCATED_LRU, MF_IGNORED);
1490 res = identify_page_state(pfn, p, page_flags);
1503 unsigned long pfn;
1518 * @pfn: Page Number of the corrupted page
1532 void memory_failure_queue(unsigned long pfn, int flags)
1537 .pfn = pfn,
1547 pfn);
1568 soft_offline_page(entry.pfn, entry.flags);
1570 memory_failure(entry.pfn, entry.flags);
1603 #define unpoison_pr_info(fmt, pfn, rs) \
1606 pr_info(fmt, pfn); \
1611 * @pfn: Page number of the to be unpoisoned page
1621 int unpoison_memory(unsigned long pfn)
1629 if (!pfn_valid(pfn))
1632 p = pfn_to_page(pfn);
1637 pfn, &unpoison_rs);
1643 pfn, &unpoison_rs);
1649 pfn, &unpoison_rs);
1655 pfn, &unpoison_rs);
1666 pfn, &unpoison_rs);
1674 pfn, &unpoison_rs);
1687 pfn, &unpoison_rs);
1694 if (freeit && !(pfn == my_zero_pfn(0) && page_count(p) == 1))
1791 unsigned long pfn = page_to_pfn(page);
1813 pr_info("soft offline: %#lx page already poisoned\n", pfn);
1830 pr_info("soft_offline: %#lx: invalidated\n", pfn);
1848 pfn, msg_page[huge], ret, page->flags, &page->flags);
1854 pfn, msg_page[huge], page_count(page), page->flags, &page->flags);
1878 * @pfn: pfn to soft-offline
1898 int soft_offline_page(unsigned long pfn, int flags)
1904 WARN_ON_ONCE(!pfn_valid(pfn) && (flags & MF_COUNT_INCREASED));
1906 if (!pfn_valid(pfn))
1909 ref_page = pfn_to_page(pfn);
1912 page = pfn_to_online_page(pfn);
1919 pr_info("%s: %#lx page already poisoned\n", __func__, pfn);
1942 __func__, pfn, page->flags, &page->flags);