linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@sgi.com>
To: Jesse Barnes <jesse.barnes@intel.com>
Cc: Martin Bligh <mbligh@mbligh.org>, Andi Kleen <ak@suse.de>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	akpm@google.com, linux-kernel@vger.kernel.org,
	Christoph Hellwig <hch@infradead.org>,
	James Bottomley <James.Bottomley@steeleye.com>,
	linux-mm@kvack.org
Subject: Re: [RFC] Initial alpha-0 for new page allocator API
Date: Fri, 22 Sep 2006 14:21:50 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0609221421170.9495@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <200609221414.00667.jesse.barnes@intel.com>

On Fri, 22 Sep 2006, Jesse Barnes wrote:

> I was suggesting something like:
> 
> 	high = dev ? dev->coherent_dma_mask : 16*1024*1024;
> 
> instead.  May as well combine your NULL check and your assignment.  It'll 
> also do the right thing for 64 bit devices so we don't put unnecessary 
> pressure on the 32 bit range.  Or am I spacing out and reading the code 
> wrong?

Ahh.. Yes something like this will save a lot of lines:

Index: linux-2.6.18-rc7-mm1/arch/i386/kernel/pci-dma.c
===================================================================
--- linux-2.6.18-rc7-mm1.orig/arch/i386/kernel/pci-dma.c	2006-09-22 15:37:41.000000000 -0500
+++ linux-2.6.18-rc7-mm1/arch/i386/kernel/pci-dma.c	2006-09-22 16:20:49.849799156 -0500
@@ -26,8 +26,6 @@ void *dma_alloc_coherent(struct device *
 			   dma_addr_t *dma_handle, gfp_t gfp)
 {
 	void *ret;
-	unsigned long low = 0L;
-	unsigned long high = 0xffffffff;
 	struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL;
 	int order = get_order(size);
 	/* ignore region specifiers */
@@ -46,14 +44,9 @@ void *dma_alloc_coherent(struct device *
 			return NULL;
 	}
 
-	if (dev == NULL)
-		/* Apply safe ISA LIMITS */
-		high = 16*1024*1024L;
-	else
-	if (dev->coherent_dma_mask < 0xffffffff)
-		high = dev->coherent_dma_mask;
-
-	ret = page_address(alloc_pages_range(low, high, gfp, order));
+	ret = page_address(alloc_pages_range(0L,
+		dev ? dev->coherent_dma_mask : 16*1024*1024,
+		gfp, order));
 
 	if (ret != NULL) {
 		memset(ret, 0, size);

--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2006-09-22 21:21 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-22  4:02 Christoph Lameter
2006-09-22  6:17 ` Andi Kleen
2006-09-22 16:35   ` Christoph Lameter
2006-09-22 19:10     ` Andi Kleen
2006-09-22 19:17       ` Christoph Lameter
2006-09-22 19:24       ` Martin Bligh
2006-09-22 20:10       ` Alan Cox
2006-09-22 20:02         ` Andi Kleen
2006-09-22 20:14           ` Martin Bligh
2006-09-22 20:23             ` Christoph Lameter
2006-09-22 20:41               ` Jesse Barnes
2006-09-22 21:01                 ` Christoph Lameter
2006-09-22 21:14                   ` Jesse Barnes
2006-09-22 21:21                     ` Christoph Lameter [this message]
2006-09-22 20:48               ` Andi Kleen
2006-09-22 21:13                 ` Christoph Lameter
2006-09-22 21:32                 ` Christoph Lameter
2006-09-22 23:34               ` More thoughts on getting rid of ZONE_DMA Andi Kleen
2006-09-23  0:23                 ` Christoph Lameter
2006-09-23  0:39                   ` Andi Kleen
2006-09-23  0:25                 ` Christoph Lameter
2006-09-23  0:37                   ` Andi Kleen
2006-09-24  2:13                 ` Christoph Lameter
2006-09-24  2:36                   ` Martin J. Bligh
2006-09-24  7:26                     ` Andi Kleen
2006-09-24  7:19                   ` Andi Kleen
2006-09-22 17:36   ` [RFC] Initial alpha-0 for new page allocator API Christoph Lameter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0609221421170.9495@schroedinger.engr.sgi.com \
    --to=clameter@sgi.com \
    --cc=James.Bottomley@steeleye.com \
    --cc=ak@suse.de \
    --cc=akpm@google.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=hch@infradead.org \
    --cc=jesse.barnes@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mbligh@mbligh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox