Lines Matching defs:kpage

1180  * @page:     the page we are replacing by kpage
1181 * @kpage: the ksm page we replace page by
1187 struct page *kpage, pte_t orig_pte)
1228 VM_BUG_ON_PAGE(PageAnon(kpage) && PageAnonExclusive(kpage), kpage);
1234 if (!is_zero_pfn(page_to_pfn(kpage))) {
1235 get_page(kpage);
1236 page_add_anon_rmap(kpage, vma, addr, RMAP_NONE);
1237 newpte = mk_pte(kpage, vma->vm_page_prot);
1244 newpte = pte_mkdirty(pte_mkspecial(pfn_pte(page_to_pfn(kpage), vma->vm_page_prot)));
1283 * @page: the PageAnon page that we want to replace with kpage
1284 * @kpage: the PageKsm page that we want to map instead of page,
1285 * or NULL the first time when we want to use page as kpage.
1290 struct page *page, struct page *kpage)
1295 if (page == kpage) /* ksm page forked */
1323 if (!kpage) {
1338 } else if (pages_identical(page, kpage))
1339 err = replace_page(vma, page, kpage, orig_pte);
1350 * but no new kernel page is allocated: kpage must already be a ksm page.
1355 struct page *page, struct page *kpage)
1366 err = try_to_merge_one_page(vma, page, kpage);
1378 trace_ksm_merge_with_ksm_page(kpage, page_to_pfn(kpage ? kpage : page),
1387 * This function returns the kpage if we successfully merged two identical
1753 * than kpage, but that involves more changes.
1881 static struct ksm_stable_node *stable_tree_insert(struct page *kpage)
1891 kpfn = page_to_pfn(kpage);
1944 ret = memcmp_pages(kpage, tree_page);
1964 set_page_stable_node(kpage, stable_node_dup);
2121 struct page *kpage;
2147 kpage = stable_tree_search(page);
2148 if (kpage == page && rmap_item->head == stable_node) {
2149 put_page(kpage);
2155 if (kpage) {
2156 if (PTR_ERR(kpage) == -EBUSY)
2159 err = try_to_merge_with_ksm_page(rmap_item, page, kpage);
2165 lock_page(kpage);
2166 stable_tree_append(rmap_item, page_stable_node(kpage),
2168 unlock_page(kpage);
2170 put_page(kpage);
2221 kpage = try_to_merge_two_pages(rmap_item, page,
2236 if (kpage) {
2241 lock_page(kpage);
2242 stable_node = stable_tree_insert(kpage);
2249 unlock_page(kpage);