Re: [patch, 2.5] __vmalloc allocates spurious page?

From: Andrew Morton (akpm@digeo.com)
Date: Tue Oct 15 2002 - 17:21:18 EST


Russell King wrote:
>
> On Wed, Oct 16, 2002 at 12:58:12AM +0300, Marcus Alanen wrote:
> > >The unnecessary page is allocated only if size is initially a multiple
> > >of PAGE_SIZE, which sounds like a common case.
> >
> > Actually, size is already PAGE_ALIGNed, so we get the amount of pages
> > even easier.
>
> IIRC, back in the dim and distant past, the extra page was originally to
> catch things running off the end of their space (eg, modules). The
> idea was that modules (and other vmalloc'd areas) would be separated
> by one unmapped page.
>
> It looks like this got broken recently though.

Still there I think.

struct vm_struct *get_vm_area(unsigned long size, unsigned long flags)
{
        ...

        /*
         * We always allocate a guard page.
         */
        size += PAGE_SIZE;

Marcus's patch looks reasonable.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Oct 15 2002 - 22:00:58 EST