Re: + pagewalk-update-page-table-walker-core.patch added to -mm tree

From: Kirill A. Shutemov
Date: Mon May 26 2014 - 07:35:33 EST


On Mon, Feb 10, 2014 at 02:42:08PM -0800, akpm@xxxxxxxxxxxxxxxxxxxx wrote:
> diff -puN include/linux/mm.h~pagewalk-update-page-table-walker-core include/linux/mm.h
> --- a/include/linux/mm.h~pagewalk-update-page-table-walker-core
> +++ a/include/linux/mm.h
> @@ -1075,10 +1075,18 @@ void unmap_vmas(struct mmu_gather *tlb,
> * @pte_entry: if set, called for each non-empty PTE (4th-level) entry
> * @pte_hole: if set, called for each hole at all levels
> * @hugetlb_entry: if set, called for each hugetlb entry
> - * *Caution*: The caller must hold mmap_sem() if @hugetlb_entry
> - * is used.
> + * @test_walk: caller specific callback function to determine whether
> + * we walk over the current vma or not. A positive returned
> + * value means "do page table walk over the current vma,"
> + * and a negative one means "abort current page table walk
> + * right now." 0 means "skip the current vma."

This comment conflicts with comment for walk_page_test() and code itself:

> +/*
> + * Decide whether we really walk over the current vma on [@start, @end)
> + * or skip it. When we skip it, we set @walk->skip to 1.
> + * The return value is used to control the page table walking to
> + * continue (for zero) or not (for non-zero).
> + *
> + * Default check (only VM_PFNMAP check for now) is used when the caller
> + * doesn't define test_walk() callback.
> + */
> +static int walk_page_test(unsigned long start, unsigned long end,
> + struct mm_walk *walk)
> +{
> + struct vm_area_struct *vma = walk->vma;
> +
> + if (walk->test_walk)
> + return walk->test_walk(start, end, walk);

...

> + } else { /* inside the found vma */
> + walk->vma = vma;
> + next = vma->vm_end;
> + err = walk_page_test(start, end, walk);
> + if (skip_lower_level_walking(walk))
> continue;
> - }
> - }
> -
> - if (pgd_none_or_clear_bad(pgd)) {
> - if (walk->pte_hole)
> - err = walk->pte_hole(addr, next, walk);
> if (err)
> break;
> - pgd++;
> - continue;

--
Kirill A. Shutemov
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/