From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752848AbcERIsa (ORCPT ); Wed, 18 May 2016 04:48:30 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:33861 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752696AbcERIs1 (ORCPT ); Wed, 18 May 2016 04:48:27 -0400 Date: Wed, 18 May 2016 10:48:25 +0200 From: Michal Hocko To: lunar12 lunartwix Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Joonsoo Kim , Minchan Kim , Marek Szyprowski Subject: Re: malloc() size in CMA region seems to be aligned to CMA_ALIGNMENT Message-ID: <20160518084824.GA21680@dhcp22.suse.cz> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [CC linux-mm and some usual suspects] On Tue 17-05-16 23:37:55, lunar12 lunartwix wrote: > A 4MB dma_alloc_coherent in kernel after malloc(2*1024) 40 times in > CMA region by user space will cause an error on our ARM 3.18 kernel > platform with a 32MB CMA. > > It seems that the malloc in CMA region will be aligned to > CMA_ALIGNMENT everytime even if the requested malloc size is very > small so the CMA region is not available after the malloc operations. > > Is there any configuraiton that can change this behavior?? > > Thanks > > Cheers > Ken -- Michal Hocko SUSE Labs