aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorHugh Dickins <hugh@veritas.com>2005-10-29 21:16:04 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-30 00:40:38 -0400
commit404351e67a9facb475abf1492245374a28d13e90 (patch)
tree5ef4e78b399b36a46eda339ad0cd27556fc5b9a2 /kernel
parentfc2acab31be8e869b2d5f6de12f557f6f054f19c (diff)
[PATCH] mm: mm_init set_mm_counters
How is anon_rss initialized? In dup_mmap, and by mm_alloc's memset; but that's not so good if an mm_counter_t is a special type. And how is rss initialized? By set_mm_counter, all over the place. Come on, we just need to initialize them both at once by set_mm_counter in mm_init (which follows the memcpy when forking). Signed-off-by: Hugh Dickins <hugh@veritas.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/fork.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index e2ff11f8c1b0..25caa02e2eac 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -198,8 +198,6 @@ static inline int dup_mmap(struct mm_struct * mm, struct mm_struct * oldmm)
198 mm->free_area_cache = oldmm->mmap_base; 198 mm->free_area_cache = oldmm->mmap_base;
199 mm->cached_hole_size = ~0UL; 199 mm->cached_hole_size = ~0UL;
200 mm->map_count = 0; 200 mm->map_count = 0;
201 set_mm_counter(mm, rss, 0);
202 set_mm_counter(mm, anon_rss, 0);
203 cpus_clear(mm->cpu_vm_mask); 201 cpus_clear(mm->cpu_vm_mask);
204 mm->mm_rb = RB_ROOT; 202 mm->mm_rb = RB_ROOT;
205 rb_link = &mm->mm_rb.rb_node; 203 rb_link = &mm->mm_rb.rb_node;
@@ -323,6 +321,8 @@ static struct mm_struct * mm_init(struct mm_struct * mm)
323 INIT_LIST_HEAD(&mm->mmlist); 321 INIT_LIST_HEAD(&mm->mmlist);
324 mm->core_waiters = 0; 322 mm->core_waiters = 0;
325 mm->nr_ptes = 0; 323 mm->nr_ptes = 0;
324 set_mm_counter(mm, rss, 0);
325 set_mm_counter(mm, anon_rss, 0);
326 spin_lock_init(&mm->page_table_lock); 326 spin_lock_init(&mm->page_table_lock);
327 rwlock_init(&mm->ioctx_list_lock); 327 rwlock_init(&mm->ioctx_list_lock);
328 mm->ioctx_list = NULL; 328 mm->ioctx_list = NULL;