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

Marcus Alanen (marcus@infa.abo.fi)
Wed, 16 Oct 2002 00:58:12 +0300


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

Marcus

diff -Naurd --exclude-from=/home/maalanen/linux/base/diff_exclude linus-2.5.42/mm/vmalloc.c msa-2.5.42/mm/vmalloc.c
--- linus-2.5.42/mm/vmalloc.c Sat Oct 12 16:42:57 2002
+++ msa-2.5.42/mm/vmalloc.c Wed Oct 16 00:52:33 2002
@@ -387,7 +387,7 @@
if (!area)
return NULL;

- nr_pages = (size+PAGE_SIZE) >> PAGE_SHIFT;
+ nr_pages = size >> PAGE_SHIFT;
array_size = (nr_pages * sizeof(struct page *));

area->nr_pages = nr_pages;

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