Re: a little improvement for vmalloc

From: Andrew Morton
Date: Wed Jan 05 2005 - 22:40:15 EST


Zhonglin Zhang <zhonglinzh@xxxxxxxxxxxxxxxxx> wrote:
>
> In FUNCTION __vmalloc ,
>
> There is a statement;
>
> if (!size || (size >> PAGE_SHIFT) > num_physpages)
> return NULL;

Probably the second part of the test should be removed. If the requested
area size is

a) less than the size of the vmalloc arena and

b) more than the number of allocatable pages

then yes, the machine will have a ton of trouble allocating the memory and
will actually lock up.

But the only way that will happen is if some code is made to do a large
number of smaller vmallocs. Nobody does a huge single vmalloc like that.

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