public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Martin Bligh <mbligh@mbligh.org>
To: Christoph Lameter <clameter@sgi.com>
Cc: Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org, Rohit Seth <rohitseth@google.com>,
	jesse.barnes@intel.com, anton@samba.org
Subject: Re: ZONE_DMA
Date: Fri, 22 Sep 2006 10:35:36 -0700	[thread overview]
Message-ID: <45141EE8.4030607@mbligh.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0609211937460.4433@schroedinger.engr.sgi.com>

Christoph Lameter wrote:
> On Thu, 21 Sep 2006, Martin Bligh wrote:
> 
> 
>>Just ignoring GFP_DMA in the allocator seems like a horrible violation
>>to me. GFP_DMA means "give me memory from ZONE_DMA". We're both well
>>aware that the whole concept of ZONE_DMA doesn't make much sense, but
>>still, that's what it does.
> 
> 
> We agreed that the definition of ZONE_DMA is not consistent across 
> architectures.
> 
> The concept of ZONE_DMA makes only sense in terms of an architectures 
> definition if a memory boundary (MAX_DMA_ADDRESS) exists for special DMA 
> devices not able to reach all of memory. If we do not have ZONE_DMA then the 
> architecture has to remove the definition of CONFIG_ZONE_DMA 
> and with that action told us that it is allowable to ignore GFP_DMA since 
> all devices can do DMA to all of memory (and all of memory is memory 
> without a border which is of course in ZONE_NORMAL).
> 
> GFP_DMA like GFP_HIGHMEM and GFP_DMA32 means give me memory from the zone 
> if its there. If not (the arch has no such memory) we fall back to ZONE_NORMAL.
> 
> This is fully consistent with established uses.

Given that the definition of ZONE_DMA is, I think we agree, nonsensical
in generic code anyway, whatever we do is going to be a pain.

I disagree that what you're doing is consistent with established
usage, see PPC64 for example, which I assumed you'd changed to be
consistent with what you're doing ... but it seems you haven't.

Your definition is one way of interpreting the current setup. It even
makes some sort of sense, I'll admit. However, there are other
definitions that make perfect sense too, which just goes to show that
the concept of ZONE_DMA is just a frigging inconsistent mess to start
with.

>>So if you just put all of memory in ZONE_DMA for your particular
>>machine, and bumped the DMA limit up to infinity, we wouldn't need
>>any of these patches, right? Which would also match what the other
>>arches do for this (eg PPC64).
> 
> That would mean abusing ZONE_DMA for a purpose it was not intended for. 
> ZOME_DMA is used to partition memory for a DMA not for covering all of 
> memory. That works yes but it shows a misunderstanding of the purpose for 
> which ZONE_DMA was created.

That is one possible way of defining it, but seeing as there is no
agreed to, documented definition, it's hard to tell whether this trumps
such other defined constants such as "GFP_DMA means gives me memory from
ZONE_DMA", which you're now violating.

> Also if you would do that then ZONE_NORMAL would be empty and you would 
> not be able to reach the goal of a system with a single zone. The slab 
> allocator gets thoroughly confused and waste pages allocating 
> memory in different slabs for ZONE_NORMAL and ZONE_DMA but they end up in 
> the same ZONE_DMA. Various other bits and pieces of the VM behave in 
> strange way but it works mostly. Seems that you got lucky but this should 
> be fixed.

It seems odd that PPC64 has worked fine this way for a long time then?

> ZONE_NORMAL is DMAable. GFP_DMA has never meant this is for DMA but it has 
> always meant this is for a special restricted DMA zone. That is also why 
> you have GFP_DMA32. Both GFP_DMA and GFP_DMA32 select special restricted 
> memory areas for handicapped DMA devices that are not able to reach all of 
> memory. Neither should cover all of memory.

The last sentence in this is your opinion, not an agreed-to definition.

Look, whatever we do is not going to be wholly clean, as the definitons
and requirements we start from are loose, inconsistent and somewhat
contradictary on occasion. So what we are left with is picking something
that is:

1. As consistent as possible across architectures.
2. As simple as possible.

If you can agree with the other arch maintainers (eg PPC64) that
stuffing it all in ZONE_NORMAL is somehow better than ZONE_DMA, then
maybe we can meet (1).

However, whatever you do, meeting (2) is rather hard - it's a damned
sight simpler to stuff it all in ZONE_DMA because that's the end of
the fallback list.

M.


  parent reply	other threads:[~2006-09-22 17:35 UTC|newest]

Thread overview: 128+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-20 20:54 2.6.19 -mm merge plans Andrew Morton
2006-09-20 21:08 ` Jeff Garzik
2006-09-20 21:42 ` Badari Pulavarty
2006-09-20 21:53 ` USB: fix autosuspend-autoresume with CONFIGRe: " Jiri Kosina
2006-09-20 22:09   ` Andrew Morton
2006-09-20 22:41     ` Greg KH
2006-09-20 21:55 ` Autofs4 breakage (was 2.6.19 -mm merge plans) Trond Myklebust
2006-09-20 22:13   ` Andrew Morton
2006-09-21  3:39   ` Andrew Morton
2006-09-21 23:25     ` Trond Myklebust
2006-09-22 15:55       ` Andrew Morton
2006-09-26  4:10   ` Ian Kent
2006-09-21  0:09 ` 2.6.19 -mm merge plans Martin J. Bligh
2006-09-21  0:22   ` ZONE_DMA (was: Re: 2.6.19 -mm merge plans) Andrew Morton
2006-09-21  0:31     ` Christoph Lameter
2006-09-21  1:03       ` Alan Cox
2006-09-21 15:59         ` James Bottomley
2006-09-21  0:50     ` ZONE_DMA Martin J. Bligh
2006-09-21  1:10       ` ZONE_DMA Christoph Lameter
2006-09-21  1:23         ` ZONE_DMA Martin J. Bligh
2006-09-21 15:58           ` ZONE_DMA Christoph Lameter
2006-09-21 16:57             ` ZONE_DMA Martin Bligh
2006-09-21 17:54               ` ZONE_DMA Christoph Lameter
2006-09-21 23:15                 ` ZONE_DMA Martin Bligh
2006-09-22  2:59                   ` ZONE_DMA Christoph Lameter
2006-09-22 17:21                     ` ZONE_DMA Jesse Barnes
2006-09-22 17:39                       ` ZONE_DMA Jesse Barnes
2006-09-22 18:08                         ` ZONE_DMA Christoph Lameter
2006-09-22 18:26                           ` ZONE_DMA Jesse Barnes
2006-09-22 18:32                             ` ZONE_DMA Christoph Lameter
2006-09-22 18:39                               ` ZONE_DMA Jesse Barnes
2006-09-22 18:40                                 ` ZONE_DMA Christoph Lameter
2006-09-22 19:06                                   ` ZONE_DMA Jesse Barnes
2006-09-22 19:07                                     ` ZONE_DMA Christoph Lameter
2006-09-22 17:35                     ` Martin Bligh [this message]
2006-09-22 17:37                       ` ZONE_DMA Christoph Lameter
2006-09-21  0:40   ` 2.6.19 -mm merge plans Christoph Lameter
2006-09-21  2:28 ` 2.6.19 -mm merge plans (NTP changes) john stultz
2006-09-21  2:40   ` Andrew Morton
2006-09-21 10:24   ` Roman Zippel
2006-09-25 16:50     ` john stultz
2006-09-25 17:04       ` Ray Lee
2006-09-25 17:38         ` Roman Zippel
2006-09-21  4:22 ` 2.6.19 -mm merge plans Jeff Garzik
2006-09-21  5:07   ` Andrew Morton
2006-09-21  5:23     ` Linus Torvalds
2006-09-21  9:12       ` Alan Cox
2006-09-21  6:36     ` Jeff Garzik
2006-09-21  6:48       ` Andrew Morton
2006-09-21 11:10         ` Rafael J. Wysocki
2006-09-22 13:16         ` release cycle (Re: 2.6.19 -mm merge plans) Pavel Machek
2006-09-21  9:16     ` 2.6.19 -mm merge plans Alan Cox
2006-09-21 10:55       ` Jan Engelhardt
2006-09-21 15:25       ` Linus Torvalds
2006-09-21 15:50         ` Jan Engelhardt
2006-09-21 17:59         ` Andrew Morton
2006-09-21 18:20           ` Jeff Garzik
2006-09-21 18:22           ` Linus Torvalds
2006-09-21 18:33             ` Jeff Garzik
2006-09-21 18:55               ` Andrew Morton
2006-09-21 19:46               ` Adrian Bunk
2006-09-21 20:37                 ` Diego Calleja
2006-09-21 21:35                   ` Randy.Dunlap
2006-09-21 20:38                 ` Jeff Garzik
2006-09-21 20:49                   ` Adrian Bunk
2006-09-21 21:33             ` Bill Davidsen
2006-09-21 21:33               ` Jeff Garzik
2006-09-21 21:52                 ` David Miller
2006-09-21 22:05                   ` Dave Jones
2006-09-21 22:44                     ` David Miller
2006-09-22  8:35                     ` Russell King
2006-09-22 15:48                       ` Dave Jones
2006-09-22 16:21                         ` Linus Torvalds
2006-09-22 20:08                           ` Roland Dreier
2006-09-22 20:22                             ` Jeff Garzik
2006-09-23  8:29                               ` Ryan Anderson
2006-09-24  7:48                           ` Lennert Buytenhek
2006-09-24  9:20                             ` Russell King
2006-09-24 19:38                               ` Mike Galbraith
     [not found]                               ` <20060924142353.6c725128.seanlkml@sympatico.ca>
2006-09-24 18:23                                 ` Sean
2006-09-24 22:34                                   ` Stefan Richter
     [not found]                                     ` <20060924190758.132c0008.seanlkml@sympatico.ca>
2006-09-24 23:07                                       ` Sean
2006-09-24 23:09                                 ` Russell King
     [not found]                                   ` <20060924192308.ef60880a.seanlkml@sympatico.ca>
2006-09-24 23:23                                     ` Sean
2006-09-25  0:48                                       ` Linus Torvalds
2006-10-11 14:09                                         ` Pierre Ossman
2006-09-22 16:24                         ` Alan Cox
2006-09-22 16:08                           ` Dave Jones
2006-09-22 16:29                         ` Jeff Garzik
2006-09-22 17:09                           ` Dave Jones
2006-09-22 17:11                           ` Dave Jones
2006-09-22 18:26                             ` Jeff Garzik
2006-09-22 18:26                         ` Andrew Morton
2006-09-24  6:33                           ` Lennert Buytenhek
2006-09-22  1:03                 ` Bill Davidsen
2006-09-24 18:51             ` Ingo Molnar
2006-09-25  3:07               ` Nick Piggin
2006-09-25 11:53                 ` Ingo Molnar
2006-09-25 18:57                   ` Rafael J. Wysocki
2006-09-22  6:33           ` Andi Kleen
2006-09-23  8:06   ` Andrew Morton
2006-09-23  9:52     ` David Woodhouse
2006-09-21 13:14 ` Ingo Molnar
2006-09-21 17:35   ` Andrew Morton
2006-09-22 13:06   ` Pavel Machek
2006-09-22 19:01     ` Ingo Molnar
2006-09-22 20:29       ` hires timer patchset [was Re: 2.6.19 -mm merge plans] Bill Rugolsky Jr.
2006-09-23 11:07       ` 2.6.19 -mm merge plans Pavel Machek
2006-09-22 20:12     ` Dave Jones
2006-09-21 14:04 ` Apple Motion Sensor (was: 2.6.19 -mm merge plans) Michael Hanselmann
     [not found] ` <20060921234637.GA9742@mail.ustc.edu.cn>
2006-09-21 23:46   ` 2.6.19 -mm merge plans Fengguang Wu
2006-09-21 23:59     ` Andrew Morton
     [not found]       ` <20060922003223.GA9952@mail.ustc.edu.cn>
2006-09-22  0:32         ` Fengguang Wu
2006-09-23 14:48           ` Gene Heskett
     [not found]             ` <20060924024239.GA11671@mail.ustc.edu.cn>
2006-09-24  2:42               ` Fengguang Wu
2006-09-24 14:25           ` Diego Calleja
2006-09-22  9:24 ` David Woodhouse
2006-09-22 10:10   ` David Woodhouse
2006-09-22 10:42     ` Jan Engelhardt
2006-09-22 11:20       ` David Woodhouse
2006-09-22 14:48     ` Randy.Dunlap
2006-09-23 10:44   ` David Woodhouse
2006-09-22 12:32 ` 2.6.19 -mm merge plans: AVR32 Haavard Skinnemoen
2006-09-22 14:42 ` 2.6.19 -mm merge plans Christoph Hellwig
2006-09-22 16:03   ` 2.6.19 -mm merge plans (ecryptfs) Andrew Morton
2006-09-22 16:53     ` Michael Halcrow
2006-09-25 14:59 ` [PATCH -mm updated] PCMCIA: Add few IDs into ide-cs Marcin Juszkiewicz
2006-09-25 15:48   ` Alan Cox

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=45141EE8.4030607@mbligh.org \
    --to=mbligh@mbligh.org \
    --cc=akpm@osdl.org \
    --cc=anton@samba.org \
    --cc=clameter@sgi.com \
    --cc=jesse.barnes@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rohitseth@google.com \
    /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