Re: [PATCH 1/5 V2] Align stack boundaries based on personality

From: Dave Hansen
Date: Mon Jul 28 2008 - 16:10:26 EST


On Mon, 2008-07-28 at 12:17 -0700, Eric Munson wrote:
>
> +static unsigned long personality_page_align(unsigned long addr)
> +{
> + if (current->personality & HUGETLB_STACK)
> +#ifdef CONFIG_STACK_GROWSUP
> + return HPAGE_ALIGN(addr);
> +#else
> + return addr & HPAGE_MASK;
> +#endif
> +
> + return PAGE_ALIGN(addr);
> +}
...
> - stack_top = PAGE_ALIGN(stack_top);
> + stack_top = personality_page_align(stack_top);

Just out of curiosity, why doesn't the existing small-page case seem to
care about the stack growing up/down? Why do you need to care in the
large page case?

-- Dave

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