[PATCH] mm: rss = file_rss + anon_rss
[deliverable/linux.git] / kernel / fork.c
index 280bd44ac4411634c0eb845c01be8ca3a5f22b7c..2048ed7b5872262f963c6bbb633769b7baaff4cb 100644 (file)
@@ -198,8 +198,6 @@ static inline int dup_mmap(struct mm_struct * mm, struct mm_struct * oldmm)
        mm->free_area_cache = oldmm->mmap_base;
        mm->cached_hole_size = ~0UL;
        mm->map_count = 0;
-       set_mm_counter(mm, rss, 0);
-       set_mm_counter(mm, anon_rss, 0);
        cpus_clear(mm->cpu_vm_mask);
        mm->mm_rb = RB_ROOT;
        rb_link = &mm->mm_rb.rb_node;
@@ -212,7 +210,7 @@ static inline int dup_mmap(struct mm_struct * mm, struct mm_struct * oldmm)
                if (mpnt->vm_flags & VM_DONTCOPY) {
                        long pages = vma_pages(mpnt);
                        mm->total_vm -= pages;
-                       __vm_stat_account(mm, mpnt->vm_flags, mpnt->vm_file,
+                       vm_stat_account(mm, mpnt->vm_flags, mpnt->vm_file,
                                                                -pages);
                        continue;
                }
@@ -323,6 +321,8 @@ static struct mm_struct * mm_init(struct mm_struct * mm)
        INIT_LIST_HEAD(&mm->mmlist);
        mm->core_waiters = 0;
        mm->nr_ptes = 0;
+       set_mm_counter(mm, file_rss, 0);
+       set_mm_counter(mm, anon_rss, 0);
        spin_lock_init(&mm->page_table_lock);
        rwlock_init(&mm->ioctx_list_lock);
        mm->ioctx_list = NULL;
@@ -499,7 +499,7 @@ static int copy_mm(unsigned long clone_flags, struct task_struct * tsk)
        if (retval)
                goto free_pt;
 
-       mm->hiwater_rss = get_mm_counter(mm,rss);
+       mm->hiwater_rss = get_mm_rss(mm);
        mm->hiwater_vm = mm->total_vm;
 
 good_mm:
This page took 0.02383 seconds and 5 git commands to generate.