Lines Matching refs:p
82 static int hwpoison_filter_dev(struct page *p) in hwpoison_filter_dev() argument
94 if (PageSlab(p)) in hwpoison_filter_dev()
97 mapping = page_mapping(p); in hwpoison_filter_dev()
112 static int hwpoison_filter_flags(struct page *p) in hwpoison_filter_flags() argument
117 if ((stable_page_flags(p) & hwpoison_filter_flags_mask) == in hwpoison_filter_flags()
137 static int hwpoison_filter_task(struct page *p) in hwpoison_filter_task() argument
142 if (page_cgroup_ino(p) != hwpoison_filter_memcg) in hwpoison_filter_task()
148 static int hwpoison_filter_task(struct page *p) { return 0; } in hwpoison_filter_task() argument
151 int hwpoison_filter(struct page *p) in hwpoison_filter() argument
156 if (hwpoison_filter_dev(p)) in hwpoison_filter()
159 if (hwpoison_filter_flags(p)) in hwpoison_filter()
162 if (hwpoison_filter_task(p)) in hwpoison_filter()
168 int hwpoison_filter(struct page *p) in hwpoison_filter() argument
221 void shake_page(struct page *p, int access) in shake_page() argument
223 if (!PageSlab(p)) { in shake_page()
225 if (PageLRU(p)) in shake_page()
227 drain_all_pages(page_zone(p)); in shake_page()
228 if (PageLRU(p) || is_free_buddy_page(p)) in shake_page()
237 drop_slab_node(page_to_nid(p)); in shake_page()
280 static void add_to_kill(struct task_struct *tsk, struct page *p, in add_to_kill() argument
298 tk->addr = page_address_in_vma(p, vma); in add_to_kill()
309 page_to_pfn(p), tsk->comm); in add_to_kill()
533 static int delete_from_lru_cache(struct page *p) in delete_from_lru_cache() argument
535 if (!isolate_lru_page(p)) { in delete_from_lru_cache()
540 ClearPageActive(p); in delete_from_lru_cache()
541 ClearPageUnevictable(p); in delete_from_lru_cache()
545 page_cache_release(p); in delete_from_lru_cache()
556 static int me_kernel(struct page *p, unsigned long pfn) in me_kernel() argument
564 static int me_unknown(struct page *p, unsigned long pfn) in me_unknown() argument
573 static int me_pagecache_clean(struct page *p, unsigned long pfn) in me_pagecache_clean() argument
579 delete_from_lru_cache(p); in me_pagecache_clean()
585 if (PageAnon(p)) in me_pagecache_clean()
595 mapping = page_mapping(p); in me_pagecache_clean()
609 err = mapping->a_ops->error_remove_page(mapping, p); in me_pagecache_clean()
613 } else if (page_has_private(p) && in me_pagecache_clean()
614 !try_to_release_page(p, GFP_NOIO)) { in me_pagecache_clean()
624 if (invalidate_inode_page(p)) in me_pagecache_clean()
638 static int me_pagecache_dirty(struct page *p, unsigned long pfn) in me_pagecache_dirty() argument
640 struct address_space *mapping = page_mapping(p); in me_pagecache_dirty()
642 SetPageError(p); in me_pagecache_dirty()
682 return me_pagecache_clean(p, pfn); in me_pagecache_dirty()
704 static int me_swapcache_dirty(struct page *p, unsigned long pfn) in me_swapcache_dirty() argument
706 ClearPageDirty(p); in me_swapcache_dirty()
708 ClearPageUptodate(p); in me_swapcache_dirty()
710 if (!delete_from_lru_cache(p)) in me_swapcache_dirty()
716 static int me_swapcache_clean(struct page *p, unsigned long pfn) in me_swapcache_clean() argument
718 delete_from_swap_cache(p); in me_swapcache_clean()
720 if (!delete_from_lru_cache(p)) in me_swapcache_clean()
732 static int me_huge_page(struct page *p, unsigned long pfn) in me_huge_page() argument
735 struct page *hpage = compound_head(p); in me_huge_page()
786 int (*action)(struct page *p, unsigned long pfn);
847 static int page_action(struct page_state *ps, struct page *p, in page_action() argument
853 result = ps->action(p, pfn); in page_action()
855 count = page_count(p) - 1; in page_action()
944 static int hwpoison_user_mappings(struct page *p, unsigned long pfn, in hwpoison_user_mappings() argument
958 if (PageReserved(p) || PageSlab(p)) in hwpoison_user_mappings()
960 if (!(PageLRU(hpage) || PageHuge(p))) in hwpoison_user_mappings()
970 if (PageKsm(p)) { in hwpoison_user_mappings()
975 if (PageSwapCache(p)) { in hwpoison_user_mappings()
1029 ret != SWAP_SUCCESS, p, pfn, flags); in hwpoison_user_mappings()
1071 struct page *p; in memory_failure() local
1088 p = pfn_to_page(pfn); in memory_failure()
1089 orig_head = hpage = compound_head(p); in memory_failure()
1090 if (TestSetPageHWPoison(p)) { in memory_failure()
1102 if (PageHuge(p)) in memory_failure()
1122 if (!(flags & MF_COUNT_INCREASED) && !get_hwpoison_page(p)) { in memory_failure()
1123 if (is_free_buddy_page(p)) { in memory_failure()
1132 if ((hwpoison_filter(p) && TestClearPageHWPoison(p)) in memory_failure()
1133 || (p != hpage && TestSetPageHWPoison(hpage))) { in memory_failure()
1151 if (!PageHuge(p) && PageTransHuge(hpage)) { in memory_failure()
1157 if (TestClearPageHWPoison(p)) in memory_failure()
1159 put_hwpoison_page(p); in memory_failure()
1162 VM_BUG_ON_PAGE(!page_count(p), p); in memory_failure()
1163 hpage = compound_head(p); in memory_failure()
1174 if (!PageHuge(p)) { in memory_failure()
1175 if (!PageLRU(p)) in memory_failure()
1176 shake_page(p, 0); in memory_failure()
1177 if (!PageLRU(p)) { in memory_failure()
1181 if (is_free_buddy_page(p)) { in memory_failure()
1198 if (PageCompound(p) && compound_head(p) != orig_head) { in memory_failure()
1211 page_flags = p->flags; in memory_failure()
1216 if (!PageHWPoison(p)) { in memory_failure()
1223 if (hwpoison_filter(p)) { in memory_failure()
1224 if (TestClearPageHWPoison(p)) in memory_failure()
1231 if (!PageHuge(p) && !PageTransTail(p) && !PageLRU(p)) in memory_failure()
1238 if (PageHuge(p) && PageTail(p) && TestSetPageHWPoison(hpage)) { in memory_failure()
1250 if (PageHuge(p)) in memory_failure()
1257 wait_on_page_writeback(p); in memory_failure()
1266 if (hwpoison_user_mappings(p, pfn, trapno, flags, &hpage) in memory_failure()
1276 if (PageLRU(p) && !PageSwapCache(p) && p->mapping == NULL) { in memory_failure()
1290 if ((p->flags & ps->mask) == ps->res) in memory_failure()
1293 page_flags |= (p->flags & (1UL << PG_dirty)); in memory_failure()
1299 res = page_action(ps, p, pfn); in memory_failure()
1421 struct page *p; in unpoison_memory() local
1430 p = pfn_to_page(pfn); in unpoison_memory()
1431 page = compound_head(p); in unpoison_memory()
1433 if (!PageHWPoison(p)) { in unpoison_memory()
1470 if (!get_hwpoison_page(p)) { in unpoison_memory()
1482 if (TestClearPageHWPoison(p)) in unpoison_memory()
1507 if (freeit && !(pfn == my_zero_pfn(0) && page_count(p) == 1)) in unpoison_memory()
1514 static struct page *new_page(struct page *p, unsigned long private, int **x) in new_page() argument
1516 int nid = page_to_nid(p); in new_page()
1517 if (PageHuge(p)) in new_page()
1518 return alloc_huge_page_node(page_hstate(compound_head(p)), in new_page()
1530 static int __get_any_page(struct page *p, unsigned long pfn, int flags) in __get_any_page() argument
1541 if (!get_hwpoison_page(p)) { in __get_any_page()
1542 if (PageHuge(p)) { in __get_any_page()
1545 } else if (is_free_buddy_page(p)) { in __get_any_page()
1550 __func__, pfn, p->flags); in __get_any_page()