Re: [PATCH 1/7] uprobes: Move alloc_page() from xol_add_vma() toxol_alloc_area()

From: Anton Arapov
Date: Mon Jan 07 2013 - 04:17:49 EST


On Mon, Dec 31, 2012 at 06:52:12PM +0100, Oleg Nesterov wrote:
> Move alloc_page() from xol_add_vma() to xol_alloc_area() to cleanup
> the code. This separates the memory allocations and consolidates the
> -EALREADY cleanups and the error handling.
>
> Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>
> ---
> kernel/events/uprobes.c | 32 +++++++++++++-------------------
> 1 files changed, 13 insertions(+), 19 deletions(-)
>
> diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
> index f883813..1456f7d 100644
> --- a/kernel/events/uprobes.c
> +++ b/kernel/events/uprobes.c
> @@ -1104,21 +1093,26 @@ static struct xol_area *xol_alloc_area(void)
>
> area = kzalloc(sizeof(*area), GFP_KERNEL);
> if (unlikely(!area))
> - return NULL;
> + goto out;
>
> area->bitmap = kzalloc(BITS_TO_LONGS(UINSNS_PER_PAGE) * sizeof(long), GFP_KERNEL);
> -
> if (!area->bitmap)
> - goto fail;
> + goto free_area;
> +
> + area->page = area->page = alloc_page(GFP_HIGHUSER);

fyi: didn't review this patch set yet, just caught the string above. ;)

Anton.
--
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/