rmap 38 remove anonmm rmap
Subsystems (7)
PATCH 54/57 rmap 38 remove anonmm rmap
From: Hugh Dickins <[email protected]>
Before moving on to anon_vma rmap, remove now what's peculiar to anonmm rmap:
the anonmm handling and the mremap move cows. Temporarily reduce page_referenced_anon and try_to_unmap_anon to stubs, so a kernel built with this patch will not swap anonymous at all.
---
25-akpm/include/linux/page-flags.h | 2 25-akpm/include/linux/rmap.h | 53 ------- 25-akpm/include/linux/sched.h | 1 25-akpm/kernel/fork.c | 13 - 25-akpm/mm/memory.c | 2 25-akpm/mm/mremap.c | 51 +------ 25-akpm/mm/rmap.c | 250 ------------------------------------- 25-akpm/mm/swapfile.c | 9 - 8 files changed, 18 insertions(+), 363 deletions(-)
include/linux/page-flags.h renamed from include/linux/page-flags.h~rmap-38-remove-anonmm-rmap +1 -1
@@ -76,7 +76,7 @@#define PG_reclaim 18/* To be reclaimed asap */ #define PG_compound 19/* Part of a compound page */ -#define PG_anon 20/* Anonymous page: anonmm in mapping */ +#define PG_anon 20/* Anonymous: anon_vma in mapping */ /*
include/linux/rmap.h renamed from include/linux/rmap.h~rmap-38-remove-anonmm-rmap +0 -53
65 lines not on this page · raw message
include/linux/sched.h renamed from include/linux/sched.h~rmap-38-remove-anonmm-rmap +0 -1
@@ -207,7 +207,6 @@ struct mm_struct {* together off init_mm.mmlist, and are protected * by mmlist_lock */ -struct anonmm *anonmm;/* For rmap to track anon mem */ unsigned long start_code, end_code, start_data, end_data;unsigned long start_brk, brk, start_stack;
kernel/fork.c renamed from kernel/fork.c~rmap-38-remove-anonmm-rmap +0 -13
@@ -432,11 +432,6 @@ struct mm_struct * mm_alloc(void)if (mm) {memset (mm,0 ,sizeof (*mm)); mm =mm_init (mm); -if (mm &&exec_rmap (mm)) { -mm_free_pgd (mm); -free_mm (mm); - mm =NULL ; - } }return mm; }
@@ -465,7 +460,6 @@ void mmput(struct mm_struct *mm)spin_unlock (&mmlist_lock);exit_aio (mm);exit_mmap (mm); -exit_rmap (mm);mmdrop (mm); } }
@@ -569,12 +563,6 @@ static int copy_mm(unsigned long clone_fif (!mm_init (mm)) goto fail_nomem; -if (dup_rmap (mm, oldmm)) { -mm_free_pgd (mm); -free_mm (mm); - goto fail_nomem; - } -if (init_new_context (tsk,mm)) goto fail_nocontext;
@@ -1298,5 +1286,4 @@ void __init proc_caches_init(void) mm_cachep =kmem_cache_create ("mm_struct" ,sizeof (struct mm_struct ),0 ,SLAB_HWCACHE_ALIGN |SLAB_PANIC ,NULL ,NULL ); -init_rmap (); }
mm/memory.c renamed from mm/memory.c~rmap-38-remove-anonmm-rmap +1 -1
@@ -1368,7 +1368,7 @@ static int do_swap_page(struct mm_structset_pte (page_table, pte);page_add_anon_rmap (page, vma, address); -if (write_access ||mremap_moved_anon_rmap (page, address)) { +if (write_access) {if (do_wp_page (mm, vma, address, page_table, pmd, pte) ==VM_FAULT_OOM ) ret =VM_FAULT_OOM ;
mm/mremap.c renamed from mm/mremap.c~rmap-38-remove-anonmm-rmap +7 -44
107 lines not on this page · raw message
mm/rmap.c renamed from mm/rmap.c~rmap-38-remove-anonmm-rmap +4 -246
290 lines not on this page · raw message
mm/swapfile.c renamed from mm/swapfile.c~rmap-38-remove-anonmm-rmap +5 -4
@@ -537,7 +537,6 @@ static int unuse_process(struct mm_struc {struct vm_area_struct * vma;unsigned long foundaddr =0 ; -int ret =0 ;/* * Go through process' page directory.
@@ -553,10 +552,12 @@ static int unuse_process(struct mm_struc } }spin_unlock (&mm->page_table_lock); -if (foundaddr &&mremap_moved_anon_rmap (page, foundaddr)) - ret =make_page_exclusive (vma, foundaddr);up_read (&mm->mmap_sem); -return ret; +/* +* Currently unuse_process cannot fail, but leave error handling +* at call sites for now, since we change it from time to time. +*/ +return 0 ; }/*
_
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>