Re: Allocating memory aligned on 1M boundary?

From: Timur Tabi
Date: Wed Aug 25 2010 - 15:35:13 EST


On Wed, Aug 25, 2010 at 1:35 PM, <david.hagood@xxxxxxxxx> wrote:

> Yes, I could allocate 2x the desired size, then use that part of what I
> allocate that is correctly aligned, but then I am guaranteed to waste half
> of what I allocate.

You can use the mechanism used in alloc_pages_exact() to free the
pages that you don't need.

--
Timur Tabi
Linux kernel developer at Freescale
--
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/