Re: [PATCH 1/1] pagemap clear_refs: modify to specify anon or mappedvma clearing

From: David Rientjes
Date: Mon Jul 27 2009 - 19:58:36 EST


On Mon, 27 Jul 2009, Moussa Ba wrote:

> The other alternative would be to just forgo the additional function
> clear_refs_walk_vma and rewrite the for loop as:
>
> for (vma = mm->mmap; vma; vma = vma->vm_next) {
> clear_refs_walk.private = vma;
> if (type < CLEAR_REFS_ALL || type > CLEAR_REFS_MAPPED)
> continue;
> if (is_vm_hugetlb_page(vma))
> continue;
> if (type == CLEAR_REFS_ANON && vma->vm_file)
> continue;
> if (type == CLEAR_REFS_MAPPED && !vma->vm_file)
> continue;
> walk_page_range(vma->vm_start, vma->vm_end, this_walk);
> }
>

That looks good, with the exception of the check for
type < CLEAR_REFS_ALL || type > CLEAR_REFS_MAPPED being in the loop.
--
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/