Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754608AbbLIOcu (ORCPT ); Wed, 9 Dec 2015 09:32:50 -0500 Received: from mailapp01.imgtec.com ([195.59.15.196]:36306 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753994AbbLIOct (ORCPT ); Wed, 9 Dec 2015 09:32:49 -0500 Subject: Re: [PATCH] MIPS: Fix DMA contiguous allocation To: Mel Gorman , Andrew Morton References: <1449569930-2118-1-git-send-email-qais.yousef@imgtec.com> <20151208141939.d0edbb72b3c15844c5ac25ea@linux-foundation.org> <20151209113635.GA15910@techsingularity.net> CC: , , , From: Qais Yousef Message-ID: <56683B8E.2000600@imgtec.com> Date: Wed, 9 Dec 2015 14:32:46 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151209113635.GA15910@techsingularity.net> Content-Type: text/plain; charset="iso-8859-15"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.154.94] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1387 Lines: 37 On 12/09/2015 11:36 AM, Mel Gorman wrote: > On Tue, Dec 08, 2015 at 02:19:39PM -0800, Andrew Morton wrote: >> On Tue, 8 Dec 2015 10:18:50 +0000 Qais Yousef wrote: >> >>> --- a/arch/mips/mm/dma-default.c >>> +++ b/arch/mips/mm/dma-default.c >>> @@ -145,7 +145,7 @@ static void *mips_dma_alloc_coherent(struct device *dev, size_t size, >>> >>> gfp = massage_gfp_flags(dev, gfp); >>> >>> - if (IS_ENABLED(CONFIG_DMA_CMA) && !(gfp & GFP_ATOMIC)) >>> + if (IS_ENABLED(CONFIG_DMA_CMA) && ((gfp & GFP_ATOMIC) != GFP_ATOMIC)) >>> page = dma_alloc_from_contiguous(dev, >>> count, get_order(size)); >>> if (!page) >> hm. It seems that the code is asking "can I do a potentially-sleeping >> memory allocation"? >> >> The way to do that under the new regime is >> >> if (IS_ENABLED(CONFIG_DMA_CMA) && gfpflags_allow_blocking(gfp)) >> >> Mel, can you please confirm? > Yes, this is the correct way it should be checked. The full flags cover > watermark and kswapd treatment which potentially could be altered by > the caller. > OK thanks both. I'll send a revised version with this change. Thanks, Qais -- 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/