Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751311AbaKFBAf (ORCPT ); Wed, 5 Nov 2014 20:00:35 -0500 Received: from mail-ie0-f172.google.com ([209.85.223.172]:55419 "EHLO mail-ie0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750915AbaKFBAd convert rfc822-to-8bit (ORCPT ); Wed, 5 Nov 2014 20:00:33 -0500 MIME-Version: 1.0 In-Reply-To: References: Date: Thu, 6 Nov 2014 09:00:33 +0800 Message-ID: Subject: Re: CMA alignment question From: Weijie Yang To: Michal Nazarewicz Cc: Gregory Fong , linux-mm@kvack.org, Laura Abbott , iamjoonsoo.kim@lge.com, Marek Szyprowski , "linux-kernel@vger.kernel.org" , Florian Fainelli , Brian Norris Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 6, 2014 at 6:01 AM, Michal Nazarewicz wrote: >> On Tue, Nov 04 2014, Gregory Fong wrote: >>> The alignment in cma_alloc() is done w.r.t. the bitmap. This is a >>> problem when, for example: >>> >>> - a device requires 16M (order 12) alignment >>> - the CMA region is not 16 M aligned > > On Wed, Nov 05 2014, Weijie Yang wrote: >> I think the device driver should ensure that situation could not occur, >> by assign suitable alignment parameter in cma_declare_contiguous(). > > What about default CMA area? Besides, I think principle of least > surprise applies here and alignment should be physical. I agree the current code doesn't handle this issue properly. However, I prefer to add specific usage to CMA interface rather than modify the cma code, Because the latter hide the issue and could waste memory. > -- > Best regards, _ _ > .o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o > ..o | Computer Science, Michał “mina86” Nazarewicz (o o) > ooo +------ooO--(_)--Ooo-- -- 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/