Lines Matching refs:p
79 static int hwpoison_filter_dev(struct page *p) in hwpoison_filter_dev() argument
91 if (PageSlab(p)) in hwpoison_filter_dev()
94 mapping = page_mapping(p); in hwpoison_filter_dev()
109 static int hwpoison_filter_flags(struct page *p) in hwpoison_filter_flags() argument
114 if ((stable_page_flags(p) & hwpoison_filter_flags_mask) == in hwpoison_filter_flags()
134 static int hwpoison_filter_task(struct page *p) in hwpoison_filter_task() argument
143 mem = try_get_mem_cgroup_from_page(p); in hwpoison_filter_task()
157 static int hwpoison_filter_task(struct page *p) { return 0; } in hwpoison_filter_task() argument
160 int hwpoison_filter(struct page *p) in hwpoison_filter() argument
165 if (hwpoison_filter_dev(p)) in hwpoison_filter()
168 if (hwpoison_filter_flags(p)) in hwpoison_filter()
171 if (hwpoison_filter_task(p)) in hwpoison_filter()
177 int hwpoison_filter(struct page *p) in hwpoison_filter() argument
230 void shake_page(struct page *p, int access) in shake_page() argument
232 if (!PageSlab(p)) { in shake_page()
234 if (PageLRU(p)) in shake_page()
236 drain_all_pages(page_zone(p)); in shake_page()
237 if (PageLRU(p) || is_free_buddy_page(p)) in shake_page()
246 drop_slab_node(page_to_nid(p)); in shake_page()
289 static void add_to_kill(struct task_struct *tsk, struct page *p, in add_to_kill() argument
307 tk->addr = page_address_in_vma(p, vma); in add_to_kill()
318 page_to_pfn(p), tsk->comm); in add_to_kill()
576 static int delete_from_lru_cache(struct page *p) in delete_from_lru_cache() argument
578 if (!isolate_lru_page(p)) { in delete_from_lru_cache()
583 ClearPageActive(p); in delete_from_lru_cache()
584 ClearPageUnevictable(p); in delete_from_lru_cache()
588 page_cache_release(p); in delete_from_lru_cache()
599 static int me_kernel(struct page *p, unsigned long pfn) in me_kernel() argument
607 static int me_unknown(struct page *p, unsigned long pfn) in me_unknown() argument
616 static int me_pagecache_clean(struct page *p, unsigned long pfn) in me_pagecache_clean() argument
622 delete_from_lru_cache(p); in me_pagecache_clean()
628 if (PageAnon(p)) in me_pagecache_clean()
638 mapping = page_mapping(p); in me_pagecache_clean()
652 err = mapping->a_ops->error_remove_page(mapping, p); in me_pagecache_clean()
656 } else if (page_has_private(p) && in me_pagecache_clean()
657 !try_to_release_page(p, GFP_NOIO)) { in me_pagecache_clean()
667 if (invalidate_inode_page(p)) in me_pagecache_clean()
681 static int me_pagecache_dirty(struct page *p, unsigned long pfn) in me_pagecache_dirty() argument
683 struct address_space *mapping = page_mapping(p); in me_pagecache_dirty()
685 SetPageError(p); in me_pagecache_dirty()
725 return me_pagecache_clean(p, pfn); in me_pagecache_dirty()
747 static int me_swapcache_dirty(struct page *p, unsigned long pfn) in me_swapcache_dirty() argument
749 ClearPageDirty(p); in me_swapcache_dirty()
751 ClearPageUptodate(p); in me_swapcache_dirty()
753 if (!delete_from_lru_cache(p)) in me_swapcache_dirty()
759 static int me_swapcache_clean(struct page *p, unsigned long pfn) in me_swapcache_clean() argument
761 delete_from_swap_cache(p); in me_swapcache_clean()
763 if (!delete_from_lru_cache(p)) in me_swapcache_clean()
775 static int me_huge_page(struct page *p, unsigned long pfn) in me_huge_page() argument
778 struct page *hpage = compound_head(p); in me_huge_page()
827 int (*action)(struct page *p, unsigned long pfn);
890 static int page_action(struct page_state *ps, struct page *p, in page_action() argument
896 result = ps->action(p, pfn); in page_action()
898 count = page_count(p) - 1; in page_action()
921 static int hwpoison_user_mappings(struct page *p, unsigned long pfn, in hwpoison_user_mappings() argument
936 if (PageReserved(p) || PageSlab(p)) in hwpoison_user_mappings()
938 if (!(PageLRU(hpage) || PageHuge(p))) in hwpoison_user_mappings()
948 if (PageKsm(p)) { in hwpoison_user_mappings()
953 if (PageSwapCache(p)) { in hwpoison_user_mappings()
1009 BUG_ON(!PageHWPoison(p)); in hwpoison_user_mappings()
1018 if (hpage != p) { in hwpoison_user_mappings()
1021 get_page(p); in hwpoison_user_mappings()
1023 lock_page(p); in hwpoison_user_mappings()
1025 *hpagep = p; in hwpoison_user_mappings()
1028 ppage = p; in hwpoison_user_mappings()
1060 ret != SWAP_SUCCESS, p, pfn, flags); in hwpoison_user_mappings()
1102 struct page *p; in memory_failure() local
1118 p = pfn_to_page(pfn); in memory_failure()
1119 hpage = compound_head(p); in memory_failure()
1120 if (TestSetPageHWPoison(p)) { in memory_failure()
1132 if (PageHuge(p)) in memory_failure()
1154 if (is_free_buddy_page(p)) { in memory_failure()
1163 if ((hwpoison_filter(p) && TestClearPageHWPoison(p)) in memory_failure()
1164 || (p != hpage && TestSetPageHWPoison(hpage))) { in memory_failure()
1190 if (!PageHuge(p)) { in memory_failure()
1197 if (is_free_buddy_page(p)) { in memory_failure()
1214 if (compound_head(p) != hpage) { in memory_failure()
1227 page_flags = p->flags; in memory_failure()
1232 if (!PageHWPoison(p)) { in memory_failure()
1239 if (hwpoison_filter(p)) { in memory_failure()
1240 if (TestClearPageHWPoison(p)) in memory_failure()
1247 if (!PageHuge(p) && !PageTransTail(p) && !PageLRU(p)) in memory_failure()
1254 if (PageHuge(p) && PageTail(p) && TestSetPageHWPoison(hpage)) { in memory_failure()
1266 if (PageHuge(p)) in memory_failure()
1273 wait_on_page_writeback(p); in memory_failure()
1282 if (hwpoison_user_mappings(p, pfn, trapno, flags, &hpage) in memory_failure()
1292 if (PageLRU(p) && !PageSwapCache(p) && p->mapping == NULL) { in memory_failure()
1306 if ((p->flags & ps->mask) == ps->res) in memory_failure()
1309 page_flags |= (p->flags & (1UL << PG_dirty)); in memory_failure()
1315 res = page_action(ps, p, pfn); in memory_failure()
1431 struct page *p; in unpoison_memory() local
1438 p = pfn_to_page(pfn); in unpoison_memory()
1439 page = compound_head(p); in unpoison_memory()
1441 if (!PageHWPoison(p)) { in unpoison_memory()
1469 if (TestClearPageHWPoison(p)) in unpoison_memory()
1492 if (freeit && !(pfn == my_zero_pfn(0) && page_count(p) == 1)) in unpoison_memory()
1499 static struct page *new_page(struct page *p, unsigned long private, int **x) in new_page() argument
1501 int nid = page_to_nid(p); in new_page()
1502 if (PageHuge(p)) in new_page()
1503 return alloc_huge_page_node(page_hstate(compound_head(p)), in new_page()
1515 static int __get_any_page(struct page *p, unsigned long pfn, int flags) in __get_any_page() argument
1526 if (!get_page_unless_zero(compound_head(p))) { in __get_any_page()
1527 if (PageHuge(p)) { in __get_any_page()
1530 } else if (is_free_buddy_page(p)) { in __get_any_page()
1535 __func__, pfn, p->flags); in __get_any_page()