public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Calling free_pages on part of the memory returned by get_free_pages?
@ 2008-04-21 21:12 Timur Tabi
  2008-04-24 19:27 ` Andi Kleen
  0 siblings, 1 reply; 4+ messages in thread
From: Timur Tabi @ 2008-04-21 21:12 UTC (permalink / raw)
  To: lkml

According to LDD3, if I call get_free_pages() to allocate X bytes, I have to
free all of those pages with free_pages().  The VM internals are a little bit
over my head, but I looked at the code and I didn't see why that is a requirement.

For example, let's say I want to allocated 6MB of physically-contiguous memory.
 If I call x = get_free_pages(11) to get 8MB.  What happens if I then do
"free_pages(x + 6 * 1024 * 1024, 9)"?

I remember doing this on the 2.4 kernel, and it never gave me any problems.

-- 
Timur Tabi
Linux kernel developer at Freescale

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-05-09 22:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-21 21:12 Calling free_pages on part of the memory returned by get_free_pages? Timur Tabi
2008-04-24 19:27 ` Andi Kleen
2008-04-24 19:32   ` Timur Tabi
2008-05-09 22:33   ` Timur Tabi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox