Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb36f5b0

Browse files
hnaztorvalds
authored andcommitted
thp: mprotect: pass vma down to page table walkers
Flushing the tlb for huge pmds requires the vma's anon_vma, so pass alongthe vma instead of the mm, we can always get the latter when we need it.Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>Reviewed-by: Rik van Riel <riel@redhat.com>Signed-off-by: Andrew Morton <akpm@linux-foundation.org>Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parentc489f12 commitb36f5b0

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

‎mm/mprotect.c‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static void change_pte_range(struct mm_struct *mm, pmd_t *pmd,
7878
pte_unmap_unlock(pte-1,ptl);
7979
}
8080

81-
staticinlinevoidchange_pmd_range(structmm_struct*mm,pud_t*pud,
81+
staticinlinevoidchange_pmd_range(structvm_area_struct*vma,pud_t*pud,
8282
unsigned longaddr,unsigned longend,pgprot_tnewprot,
8383
intdirty_accountable)
8484
{
@@ -88,14 +88,15 @@ static inline void change_pmd_range(struct mm_struct *mm, pud_t *pud,
8888
pmd=pmd_offset(pud,addr);
8989
do {
9090
next=pmd_addr_end(addr,end);
91-
split_huge_page_pmd(mm,pmd);
91+
split_huge_page_pmd(vma->vm_mm,pmd);
9292
if (pmd_none_or_clear_bad(pmd))
9393
continue;
94-
change_pte_range(mm,pmd,addr,next,newprot,dirty_accountable);
94+
change_pte_range(vma->vm_mm,pmd,addr,next,newprot,
95+
dirty_accountable);
9596
}while (pmd++,addr=next,addr!=end);
9697
}
9798

98-
staticinlinevoidchange_pud_range(structmm_struct*mm,pgd_t*pgd,
99+
staticinlinevoidchange_pud_range(structvm_area_struct*vma,pgd_t*pgd,
99100
unsigned longaddr,unsigned longend,pgprot_tnewprot,
100101
intdirty_accountable)
101102
{
@@ -107,7 +108,8 @@ static inline void change_pud_range(struct mm_struct *mm, pgd_t *pgd,
107108
next=pud_addr_end(addr,end);
108109
if (pud_none_or_clear_bad(pud))
109110
continue;
110-
change_pmd_range(mm,pud,addr,next,newprot,dirty_accountable);
111+
change_pmd_range(vma,pud,addr,next,newprot,
112+
dirty_accountable);
111113
}while (pud++,addr=next,addr!=end);
112114
}
113115

@@ -127,7 +129,8 @@ static void change_protection(struct vm_area_struct *vma,
127129
next=pgd_addr_end(addr,end);
128130
if (pgd_none_or_clear_bad(pgd))
129131
continue;
130-
change_pud_range(mm,pgd,addr,next,newprot,dirty_accountable);
132+
change_pud_range(vma,pgd,addr,next,newprot,
133+
dirty_accountable);
131134
}while (pgd++,addr=next,addr!=end);
132135
flush_tlb_range(vma,start,end);
133136
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp