Revert "mm: introduce __page_add_new_anon_rmap()"
This reverts commit 3db290da0d.
Bug: 128240262
Change-Id: Ia5a417e52de006fba4f8b1b51d9ae4db36fd9035
Signed-off-by: Minchan Kim <minchan@google.com>
This commit is contained in:
@@ -183,16 +183,8 @@ void page_add_anon_rmap(struct page *, struct vm_area_struct *,
|
||||
unsigned long, bool);
|
||||
void do_page_add_anon_rmap(struct page *, struct vm_area_struct *,
|
||||
unsigned long, int);
|
||||
void __page_add_new_anon_rmap(struct page *page, struct vm_area_struct *vma,
|
||||
unsigned long address, bool compound);
|
||||
static inline void page_add_new_anon_rmap(struct page *page,
|
||||
struct vm_area_struct *vma,
|
||||
unsigned long address, bool compound)
|
||||
{
|
||||
VM_BUG_ON_VMA(address < vma->vm_start || address >= vma->vm_end, vma);
|
||||
__page_add_new_anon_rmap(page, vma, address, compound);
|
||||
}
|
||||
|
||||
void page_add_new_anon_rmap(struct page *, struct vm_area_struct *,
|
||||
unsigned long, bool);
|
||||
void page_add_file_rmap(struct page *, bool);
|
||||
void page_remove_rmap(struct page *, bool);
|
||||
|
||||
|
||||
@@ -2688,7 +2688,7 @@ static int wp_page_copy(struct vm_fault *vmf)
|
||||
* thread doing COW.
|
||||
*/
|
||||
ptep_clear_flush_notify(vma, vmf->address, vmf->pte);
|
||||
__page_add_new_anon_rmap(new_page, vma, vmf->address, false);
|
||||
page_add_new_anon_rmap(new_page, vma, vmf->address, false);
|
||||
mem_cgroup_commit_charge(new_page, memcg, false, false);
|
||||
__lru_cache_add_active_or_unevictable(new_page, vmf->vma_flags);
|
||||
/*
|
||||
@@ -3206,7 +3206,7 @@ int do_swap_page(struct vm_fault *vmf)
|
||||
|
||||
/* ksm created a completely new copy */
|
||||
if (unlikely(page != swapcache && swapcache)) {
|
||||
__page_add_new_anon_rmap(page, vma, vmf->address, false);
|
||||
page_add_new_anon_rmap(page, vma, vmf->address, false);
|
||||
mem_cgroup_commit_charge(page, memcg, false, false);
|
||||
__lru_cache_add_active_or_unevictable(page, vmf->vma_flags);
|
||||
} else {
|
||||
@@ -3356,7 +3356,7 @@ static int do_anonymous_page(struct vm_fault *vmf)
|
||||
}
|
||||
|
||||
inc_mm_counter_fast(vma->vm_mm, MM_ANONPAGES);
|
||||
__page_add_new_anon_rmap(page, vma, vmf->address, false);
|
||||
page_add_new_anon_rmap(page, vma, vmf->address, false);
|
||||
mem_cgroup_commit_charge(page, memcg, false, false);
|
||||
__lru_cache_add_active_or_unevictable(page, vmf->vma_flags);
|
||||
setpte:
|
||||
@@ -3642,7 +3642,7 @@ int alloc_set_pte(struct vm_fault *vmf, struct mem_cgroup *memcg,
|
||||
/* copy-on-write page */
|
||||
if (write && !(vmf->vma_flags & VM_SHARED)) {
|
||||
inc_mm_counter_fast(vma->vm_mm, MM_ANONPAGES);
|
||||
__page_add_new_anon_rmap(page, vma, vmf->address, false);
|
||||
page_add_new_anon_rmap(page, vma, vmf->address, false);
|
||||
mem_cgroup_commit_charge(page, memcg, false, false);
|
||||
__lru_cache_add_active_or_unevictable(page, vmf->vma_flags);
|
||||
} else {
|
||||
|
||||
@@ -1134,7 +1134,7 @@ void do_page_add_anon_rmap(struct page *page,
|
||||
}
|
||||
|
||||
/**
|
||||
* __page_add_new_anon_rmap - add pte mapping to a new anonymous page
|
||||
* page_add_new_anon_rmap - add pte mapping to a new anonymous page
|
||||
* @page: the page to add the mapping to
|
||||
* @vma: the vm area in which the mapping is added
|
||||
* @address: the user virtual address mapped
|
||||
@@ -1144,11 +1144,12 @@ void do_page_add_anon_rmap(struct page *page,
|
||||
* This means the inc-and-test can be bypassed.
|
||||
* Page does not have to be locked.
|
||||
*/
|
||||
void __page_add_new_anon_rmap(struct page *page,
|
||||
void page_add_new_anon_rmap(struct page *page,
|
||||
struct vm_area_struct *vma, unsigned long address, bool compound)
|
||||
{
|
||||
int nr = compound ? hpage_nr_pages(page) : 1;
|
||||
|
||||
VM_BUG_ON_VMA(address < vma->vm_start || address >= vma->vm_end, vma);
|
||||
__SetPageSwapBacked(page);
|
||||
if (compound) {
|
||||
VM_BUG_ON_PAGE(!PageTransHuge(page), page);
|
||||
|
||||
Reference in New Issue
Block a user