Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753088Ab0HYTfA (ORCPT ); Wed, 25 Aug 2010 15:35:00 -0400 Received: from mail-iw0-f174.google.com ([209.85.214.174]:37532 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751660Ab0HYTe6 (ORCPT ); Wed, 25 Aug 2010 15:34:58 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=LD3dRzZiNghLETYxftGYjei+sDfo076tTyvGYyXNVwte6Jdvbcr88fYgDAWQfiRiE/ us9K8qx1kFwcvJ8Tyq280TnHLOgL2UxQ3zUQYXuqfkTeqIMPK49ySkeTt0GmOqtoSV+V Jb+iBMn9s5NNbwBRd5vV8FwG07Au6EyZIhdG0= MIME-Version: 1.0 In-Reply-To: References: Date: Wed, 25 Aug 2010 14:34:54 -0500 X-Google-Sender-Auth: cyYHknmWYJ0uLtLe3wQOh9cVDeg Message-ID: Subject: Re: Allocating memory aligned on 1M boundary? From: Timur Tabi To: david.hagood@gmail.com Cc: linux-kernel@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 631 Lines: 17 On Wed, Aug 25, 2010 at 1:35 PM, 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/