We lock the semaphore of the old "mm" for write.
Usually we do this when the corresponding VMA list is being modified.
Does "dup_mmap()" modify the old VMA list ?
Or would a "down_read(&oldmm->mmap_sem)" be enough ?
Should not we lock for write the semaphore of the new "mm" ?
It is on the "mmlist", it can be seen.
The new "vma" is on the "anon" list and on the "vma_prio_tree",
can it be done without holding for write the semaphore of the new "mm" ?
Should not we hold for write the semaphore of the new "mm"
when the new "vma" is actually added ?
Is the "page_table_lock" enough ?
Apparently, the argument "oldmm" is equal to "current->mm".
Why do we pass it as an argument ?
Thanks.