From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758161Ab1FJWJf (ORCPT ); Fri, 10 Jun 2011 18:09:35 -0400 Received: from caramon.arm.linux.org.uk ([78.32.30.218]:49663 "EHLO caramon.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753467Ab1FJWJc (ORCPT ); Fri, 10 Jun 2011 18:09:32 -0400 Date: Fri, 10 Jun 2011 23:07:48 +0100 From: Russell King - ARM Linux To: David Rientjes Cc: Linus Torvalds , Dmitry Eremin-Solenikov , Andrew Morton , KOSAKI Motohiro , tglx@linutronix.de, linux-mm@kvack.org, linux-kernel@vger.kernel.org, mel@csn.ul.ie, kamezawa.hiroyu@jp.fujitsu.com, riel@redhat.com, pavel@ucw.cz Subject: Re: [PATCH] Make GFP_DMA allocations w/o ZONE_DMA emit a warning instead of failing Message-ID: <20110610220748.GO24424@n2100.arm.linux.org.uk> References: <4DF1C9DE.4070605@jp.fujitsu.com> <20110610004331.13672278.akpm@linux-foundation.org> <20110610091233.GJ24424@n2100.arm.linux.org.uk> <20110610185858.GN24424@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 10, 2011 at 03:01:15PM -0700, David Rientjes wrote: > On Fri, 10 Jun 2011, Russell King - ARM Linux wrote: > > See Linus' reply. I quote again "on platforms where it doesn't matter it > > should be a no-op". If _you_ have a problem with that _you_ need to > > discuss it with _Linus_, not me. I'm not going to be a middle-man sitting > > between two people with different opinions. > > We're talking about two different things. Linus is saying that if GFP_DMA > should be a no-op if the hardware doesn't require DMA memory because the > kernel was correctly compiled without CONFIG_ZONE_DMA. I'm asking about a > kernel that was incorrectly compiled without CONFIG_ZONE_DMA and now we're > returning memory from anywhere even though we actually require GFP_DMA. How do you distinguish between the two states? Answer: you can't. > If you don't want to form an opinion of your own, then I have no problem > cc'ing Linus on it. I think I've made my position in this fairly clear with our previous discussions on this. The fact of the matter is that there are some drivers which use GFP_DMA because they need that on _some_ platforms but not all. Not all platforms are _broken_ with respect to DMA, and those which aren't broken don't provide a DMA zone. Therefore, it is _perfectly_ _legal_ to honor a GFP_DMA allocation on a kernel without CONFIG_ZONE_DMA set. That position appears to be reflected by Linus' response, so > I don't think he'd object to a > > #ifndef CONFIG_ZONE_DMA > WARN_ON_ONCE(1, "%s (%d): allocating DMA memory without DMA support -- " > "enable CONFIG_ZONE_DMA if needed.\n", > current->comm, current->pid); > #endif I think he will definitely object to this on the grounds that its adding useless noise for conditions which are _perfectly_ _valid_. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail6.bemta12.messagelabs.com (mail6.bemta12.messagelabs.com [216.82.250.247]) by kanga.kvack.org (Postfix) with ESMTP id 623F26B0012 for ; Fri, 10 Jun 2011 18:09:31 -0400 (EDT) Date: Fri, 10 Jun 2011 23:07:48 +0100 From: Russell King - ARM Linux Subject: Re: [PATCH] Make GFP_DMA allocations w/o ZONE_DMA emit a warning instead of failing Message-ID: <20110610220748.GO24424@n2100.arm.linux.org.uk> References: <4DF1C9DE.4070605@jp.fujitsu.com> <20110610004331.13672278.akpm@linux-foundation.org> <20110610091233.GJ24424@n2100.arm.linux.org.uk> <20110610185858.GN24424@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-ID: To: David Rientjes Cc: Linus Torvalds , Dmitry Eremin-Solenikov , Andrew Morton , KOSAKI Motohiro , tglx@linutronix.de, linux-mm@kvack.org, linux-kernel@vger.kernel.org, mel@csn.ul.ie, kamezawa.hiroyu@jp.fujitsu.com, riel@redhat.com, pavel@ucw.cz On Fri, Jun 10, 2011 at 03:01:15PM -0700, David Rientjes wrote: > On Fri, 10 Jun 2011, Russell King - ARM Linux wrote: > > See Linus' reply. I quote again "on platforms where it doesn't matter it > > should be a no-op". If _you_ have a problem with that _you_ need to > > discuss it with _Linus_, not me. I'm not going to be a middle-man sitting > > between two people with different opinions. > > We're talking about two different things. Linus is saying that if GFP_DMA > should be a no-op if the hardware doesn't require DMA memory because the > kernel was correctly compiled without CONFIG_ZONE_DMA. I'm asking about a > kernel that was incorrectly compiled without CONFIG_ZONE_DMA and now we're > returning memory from anywhere even though we actually require GFP_DMA. How do you distinguish between the two states? Answer: you can't. > If you don't want to form an opinion of your own, then I have no problem > cc'ing Linus on it. I think I've made my position in this fairly clear with our previous discussions on this. The fact of the matter is that there are some drivers which use GFP_DMA because they need that on _some_ platforms but not all. Not all platforms are _broken_ with respect to DMA, and those which aren't broken don't provide a DMA zone. Therefore, it is _perfectly_ _legal_ to honor a GFP_DMA allocation on a kernel without CONFIG_ZONE_DMA set. That position appears to be reflected by Linus' response, so > I don't think he'd object to a > > #ifndef CONFIG_ZONE_DMA > WARN_ON_ONCE(1, "%s (%d): allocating DMA memory without DMA support -- " > "enable CONFIG_ZONE_DMA if needed.\n", > current->comm, current->pid); > #endif I think he will definitely object to this on the grounds that its adding useless noise for conditions which are _perfectly_ _valid_. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org