lkml.org 
[lkml]   [2008]   [Oct]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] regression: vmalloc easily fail.
On Tue, 28 Oct 2008 14:22:16 -0700
Roland Dreier <rdreier@cisco.com> wrote:

> > I'm guessing that the missing comment explains that this is
> > intentional, to trap buffer overflows?
>
> Actually, speaking of comments, it's interesting that
> __get_vm_area_node() -- which is called from vmalloc() -- does:
>
> /*
> * We always allocate a guard page.
> */
> size += PAGE_SIZE;
>
> va = alloc_vmap_area(size, align, start, end, node, gfp_mask);
>
> and alloc_vmap_area() adds another PAGE_SIZE, as the original email
> pointed out:
>
> while (addr + size >= first->va_start && addr + size
> <= vend) { addr = ALIGN(first->va_end + PAGE_SIZE, align);
>
> I wonder if the double padding is causing a problem when things get
> too fragmented?

I suspect it's a case of off-by-one... ALIGN() might round down, and
the "+ (PAGE_SIZE-1)" was there to make it round up.
Except for that missing -1 ...

--
Arjan van de Ven Intel Open Source Technology Centre
For development, discussion and tips for power savings,
visit http://www.lesswatts.org


\
 
 \ /
  Last update: 2008-10-28 22:45    [W:0.073 / U:2.716 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site