linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: + pagewalk-update-page-table-walker-core.patch added to -mm tree
       [not found] <52f955c0.7BhMyAjSaddn+QeR%akpm@linux-foundation.org>
@ 2014-05-26 11:33 ` Kirill A. Shutemov
  0 siblings, 0 replies; only message in thread
From: Kirill A. Shutemov @ 2014-05-26 11:33 UTC (permalink / raw)
  To: n-horiguchi, linux-kernel
  Cc: mm-commits, xemul, riel, mpm, mhocko, kosaki.motohiro,
	kirill.shutemov, kamezawa.hiroyu, hannes, cpw, benh,
	aneesh.kumar, n-horiguchi

On Mon, Feb 10, 2014 at 02:42:08PM -0800, akpm@linux-foundation.org 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-05-26 11:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <52f955c0.7BhMyAjSaddn+QeR%akpm@linux-foundation.org>
2014-05-26 11:33 ` + pagewalk-update-page-table-walker-core.patch added to -mm tree Kirill A. Shutemov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).