From: Marcus Alanen <marcus@infa.abo.fi>
To: maalanen@ra.abo.fi, Andrew Morton <akpm@digeo.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [patch, 2.5] __vmalloc allocates spurious page?
Date: Wed, 16 Oct 2002 00:58:12 +0300 [thread overview]
Message-ID: <200210152158.AAA18031@infa.abo.fi> (raw)
In-Reply-To: <Pine.LNX.4.44.0210152221080.14143-100000@tuxedo.abo.fi>
>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;
next prev parent reply other threads:[~2002-10-15 21:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-15 19:32 [patch, 2.5] __vmalloc allocates spurious page? Marcus Alanen
2002-10-15 21:58 ` Marcus Alanen [this message]
2002-10-15 22:05 ` Russell King
2002-10-15 22:11 ` William Lee Irwin III
2002-10-15 22:21 ` Andrew Morton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200210152158.AAA18031@infa.abo.fi \
--to=marcus@infa.abo.fi \
--cc=akpm@digeo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maalanen@ra.abo.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox