diff options
| author | Andrew Morton <akpm@osdl.org> | 2004-05-22 08:05:47 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-05-22 08:05:47 -0700 |
| commit | fc96c90fc0de79790e77fe3a9e5147a96c453c1e (patch) | |
| tree | 1657fbecd98c502cde24ee1ca59939ef8d5f13d9 /kernel/fork.c | |
| parent | fb41b4173dbfae80fe601f528d968e9caba0c766 (diff) | |
[PATCH] rmap 16: pretend prio_tree
From: Hugh Dickins <hugh@veritas.com>
Pave the way for prio_tree by switching over to its interfaces, but actually
still implement them with the same old lists as before.
Most of the vma_prio_tree interfaces are straightforward. The interesting one
is vma_prio_tree_next, used to search the tree for all vmas which overlap the
given range: unlike the list_for_each_entry it replaces, it does not find
every vma, just those that match.
But this does leave handling of nonlinear vmas in a very unsatisfactory state:
for now we have to search again over the maximum range to find all the
nonlinear vmas which might contain a page, which of course takes away the
point of the tree. Fixed in later patch of this batch.
There is no need to initialize vma linkage all over, just do it before
inserting the vma in list or tree. /proc/pid/statm had an odd test for its
shared count: simplified to an equivalent test on vm_file.
Diffstat (limited to 'kernel/fork.c')
| -rw-r--r-- | kernel/fork.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index 8909a42c4420..3eb6ca91d29a 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -323,7 +323,7 @@ static inline int dup_mmap(struct mm_struct * mm, struct mm_struct * oldmm) tmp->vm_mm = mm; tmp->vm_next = NULL; file = tmp->vm_file; - INIT_LIST_HEAD(&tmp->shared); + vma_prio_tree_init(tmp); if (file) { struct inode *inode = file->f_dentry->d_inode; get_file(file); @@ -332,7 +332,7 @@ static inline int dup_mmap(struct mm_struct * mm, struct mm_struct * oldmm) /* insert tmp into the share list, just after mpnt */ spin_lock(&file->f_mapping->i_mmap_lock); - list_add(&tmp->shared, &mpnt->shared); + vma_prio_tree_add(tmp, mpnt); spin_unlock(&file->f_mapping->i_mmap_lock); } |
