Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[PATCH] freepgt: hugetlb area is clean

Once we're strict about clearing away page tables, hugetlb_prefault can assume
there are no page tables left within its range. Since the other arches
continue if !pte_none here, let i386 do the same.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Hugh Dickins and committed by
Linus Torvalds
021740dc 146425a3

+2 -46
+2 -9
arch/i386/mm/hugetlbpage.c
··· 249 249 goto out; 250 250 } 251 251 252 - if (!pte_none(*pte)) { 253 - pmd_t *pmd = (pmd_t *) pte; 254 - 255 - page = pmd_page(*pmd); 256 - pmd_clear(pmd); 257 - mm->nr_ptes--; 258 - dec_page_state(nr_page_table_pages); 259 - page_cache_release(page); 260 - } 252 + if (!pte_none(*pte)) 253 + continue; 261 254 262 255 idx = ((addr - vma->vm_start) >> HPAGE_SHIFT) 263 256 + (vma->vm_pgoff >> (HPAGE_SHIFT - PAGE_SHIFT));
-37
arch/ppc64/mm/hugetlbpage.c
··· 203 203 unsigned long start = seg << SID_SHIFT; 204 204 unsigned long end = (seg+1) << SID_SHIFT; 205 205 struct vm_area_struct *vma; 206 - unsigned long addr; 207 - struct mmu_gather *tlb; 208 206 209 207 BUG_ON(seg >= 16); 210 208 ··· 210 212 vma = find_vma(mm, start); 211 213 if (vma && (vma->vm_start < end)) 212 214 return -EBUSY; 213 - 214 - /* Clean up any leftover PTE pages in the region */ 215 - spin_lock(&mm->page_table_lock); 216 - tlb = tlb_gather_mmu(mm, 0); 217 - for (addr = start; addr < end; addr += PMD_SIZE) { 218 - pgd_t *pgd = pgd_offset(mm, addr); 219 - pmd_t *pmd; 220 - struct page *page; 221 - pte_t *pte; 222 - int i; 223 - 224 - if (pgd_none(*pgd)) 225 - continue; 226 - pmd = pmd_offset(pgd, addr); 227 - if (!pmd || pmd_none(*pmd)) 228 - continue; 229 - if (pmd_bad(*pmd)) { 230 - pmd_ERROR(*pmd); 231 - pmd_clear(pmd); 232 - continue; 233 - } 234 - pte = (pte_t *)pmd_page_kernel(*pmd); 235 - /* No VMAs, so there should be no PTEs, check just in case. */ 236 - for (i = 0; i < PTRS_PER_PTE; i++) { 237 - BUG_ON(!pte_none(*pte)); 238 - pte++; 239 - } 240 - page = pmd_page(*pmd); 241 - pmd_clear(pmd); 242 - mm->nr_ptes--; 243 - dec_page_state(nr_page_table_pages); 244 - pte_free_tlb(tlb, page); 245 - } 246 - tlb_finish_mmu(tlb, start, end); 247 - spin_unlock(&mm->page_table_lock); 248 215 249 216 return 0; 250 217 }