[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <49077E1A.5080105@redhat.com>
Date: Tue, 28 Oct 2008 23:03:22 +0200
From: Avi Kivity <avi@...hat.com>
To: Glauber Costa <glommer@...hat.com>
CC: linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
aliguori@...emonkey.ws, npiggin@...e.de,
Jeremy Fitzhardinge <jeremy@...p.org>,
Krzysztof Helt <krzysztof.h1@...zta.fm>
Subject: Re: [PATCH] regression: vmalloc easily fail.
Glauber Costa wrote:
> Commit db64fe02258f1507e13fe5212a989922323685ce broke
> KVM (the symptom) for me. The cause is that vmalloc
> allocations fail, despite of the fact that /proc/meminfo
> shows plenty of vmalloc space available.
>
> After some investigation, it seems to me that the current
> way to compute the next addr in the rb-tree transversal
> leaves a spare page between each allocation. After a few
> allocations, regardless of their size, we run out of vmalloc
> space.
>
>
> while (addr + size >= first->va_start && addr + size <= vend) {
> - addr = ALIGN(first->va_end + PAGE_SIZE, align);
> + addr = ALIGN(first->va_end, align);
>
> n = rb_next(&first->rb_node);
> if (n)
>
I'm guessing that the missing comment explains that this is intentional,
to trap buffer overflows?
(okay that was a cheap shot. I don't comment nearly enough either)
Even if you leave a page between allocations, I don't see how you can
fail a one page allocation, unless you've allocated at least N/2 pages
(where N is the size of the vmalloc space in pages).
--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists