Re: [PATCH 10/28] mm: Make use of the anon_vma ref count
From: Peter Zijlstra
Date: Wed Jun 09 2010 - 09:33:10 EST
On Wed, 2010-06-09 at 14:22 +0100, Mel Gorman wrote:
> This comment is no longer strictly correct. anon_vma_alloc() can also be
> called from anon_vma_fork where the root of the newly allocated anon_vma
> will be set to the same as the parents anon_vma. Maybe something like
>
> /*
> * Initialise the anon_vma root to point to itself. If called from
> * fork, the root will be reset to the parents anon_vma
> */
Sure, I'll change the comment.
> Else, just leave the initialisation of the root where it was but only
> init the refcount here.
Ah, that would lead to problems. We use put_anon_vma() to free in the
create error path, and __put_anon_vma() will also check the
anon_vma->root, so by not setting it the error path will explode.
--
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/