1 Jun 2003 01:48
Re: Always passing mm and vma down (was: [RFC][PATCH] Convert do_no_page() to a hook to avoid DFS race)
Paul E. McKenney <paulmck <at> us.ibm.com>
2003-05-31 23:48:16 GMT
2003-05-31 23:48:16 GMT
On Sat, May 31, 2003 at 10:46:18AM +0200, Ingo Oeser wrote: > On Fri, May 30, 2003 at 04:41:50PM -0700, Paul E. McKenney wrote: > > -struct page * > > -ia32_install_shared_page (struct vm_area_struct *vma, unsigned long address, int no_share) > > +int > > +ia32_install_shared_page (struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, int write_access, pmd_t *pmd) > > Why do we always pass mm and vma down, even if vma->vm_mm > contains the mm, where the vma belongs to? Is the connection > between a vma and its mm also protected by the mmap_sem? > > Is this really necessary or an oversight and we waste a lot of > stack in a lot of places? > > If we just need it for accounting: We need current->mm, if we > need it to locate the next vma relatively to this vma, vma->vm_mm > is the one. Interesting point. The original do_no_page() API does this as well: static int do_no_page(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, int write_access, pte_t *page_table, pmd_t *pmd) As does do_anonymous_page(). I assumed that there were corner cases where this one-to-one correspondence did not exist, but must confess that I did not go looking for them.(Continue reading)
Thanx, Paul
diff -urN -X dontdiff linux-2.5.70-mm3/arch/i386/mm/hugetlbpage.c linux-2.5.70-mm3.install_new_page_hch/arch/i386/mm/hugetlbpage.c
--- linux-2.5.70-mm3/arch/i386/mm/hugetlbpage.c 2003-05-26 18:00:58.000000000 -0700
+++ linux-2.5.70-mm3.install_new_page_hch/arch/i386/mm/hugetlbpage.c 2003-06-01
10:43:06.000000000 -0700
<at> <at> -487,11 +487,13 <at> <at>
* hugegpage VMA. do_page_fault() is supposed to trap this, so BUG is we get
* this far.
*/
-static struct page *hugetlb_nopage(struct vm_area_struct *vma,
- unsigned long address, int unused)
+static int hugetlb_nopage(struct mm_struct *mm, struct vm_area_struct *vma,
+ unsigned long address, int write_access, pte_t *page_table, pmd_t *pmd)
RSS Feed