Forget this. Sorry for noise.
==
This is a memo for myself.
*) at fork, when copying a vma for file, vma_prio_tree_add() is called
before copying page tables.
There are several patterns.
Assume tasks named as t1,t2,t3,t4,t5 and their own vmas v1,v2,v3,v4,v5 which map
a range in address spaces.
(a) t1 forks t2.
v1 is in prio_tree, v2 for t2 will be pointed by ->head pointer.
\
v1 --(head)---> v2
/ \
? ?
vma_prio_tree_foreach() order : v1->v2.
(b) after (a), t2 forks t3. (list_add() is used.)
\
v1 --(head)--> v2 ->(list.next)->v3
/ \
? ?
vma_prio_tree_foreach() order : v1->v2->v3
(c) after (b), t1 forks t4.
\
v1 --(head)--> v2 ->(list.next)->v3->v4
/ \
? ?
vma_prio_tree_foreach() order : v1->v2->v3->v4
(d) after (c), t4 forks t5.
\
v1 --(head)--> v2 ->(list.next)->v3->v4->v5
/ \
? ?
vma_prio_tree_foreach() order : v1->v2->v3->v4->v5
(e) after (c), t3 forks t5.
\
v1 --(head)--> v2 ->(list.next)->v3->v5->v4-
/ \
? ?
vma_prio_tree_foreach() order : v1->v2->v3->v5->v4
.....in any case, it seems vma_prio_tree_foreach() finds
the parent's vma 1st.
Thx,
-Kame
--