Re: [PATCH 2/5] mm: replace vma prio_tree with an interval tree

From: Hillf Danton
Date: Tue Aug 14 2012 - 08:11:19 EST


On Tue, Aug 7, 2012 at 3:25 PM, Michel Lespinasse <walken@xxxxxxxxxx> wrote:

> +#define ITSTRUCT struct vm_area_struct
> +#define ITSTART(n) ((n)->vm_pgoff)
> +#define ITLAST(n) ((n)->vm_pgoff + \
> + (((n)->vm_end - (n)->vm_start) >> PAGE_SHIFT) - 1)

[...]

> @@ -1547,7 +1545,6 @@ static int try_to_unmap_file(struct page *page, enum ttu_flags flags)
> struct address_space *mapping = page->mapping;
> pgoff_t pgoff = page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT);
> struct vm_area_struct *vma;
> - struct prio_tree_iter iter;
> int ret = SWAP_AGAIN;
> unsigned long cursor;
> unsigned long max_nl_cursor = 0;
> @@ -1555,7 +1552,7 @@ static int try_to_unmap_file(struct page *page, enum ttu_flags flags)
> unsigned int mapcount;
>
> mutex_lock(&mapping->i_mmap_mutex);
> - vma_prio_tree_foreach(vma, &iter, &mapping->i_mmap, pgoff, pgoff) {
> + vma_interval_tree_foreach(vma, &mapping->i_mmap, pgoff, pgoff) {

Given the above defines for ITSTART and ITLAST, page index perhaps could not
be used directly in scanning interval tree for vma when ttum hugetlb page?
--
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/