Re: Proposal: Eliminate GFP_DMA

From: Rogier Wolff (R.E.Wolff@BitWizard.nl)
Date: Tue Mar 04 2003 - 12:56:16 EST


On Fri, Feb 28, 2003 at 03:55:37PM +0000, Alan Cox wrote:
> On Fri, 2003-02-28 at 14:34, Matthew Wilcox wrote:
> > umm. are you volunteering to convert drivers/net/macmace.c to the pci_*
> > API then? also, GFP_DMA is used on, eg, s390 to get memory below 2GB and
> > on ia64 to get memory below 4GB.

> The ia64 is a fine example of how broken it is. People have to hack
> around with GFP_DMA meaning different things on ia64 to everything
> else. It needs to die.

All the modifier flags on kmalloc and GFP should be "memory allocation
descriptors".

A memory allocation descriptor is a linked list of something like:
        <memory pool pointer>
        <function to call when out of memory on this pool>
        <next memory pool>

An "atomic" modifier will not have a function pointer that waits for
memory when "out of memory".

A DMA pool descriptor will only point to pools that have that
capability.

Drivers will eventually have to start specifying what they really
need: GFP_1M, GFP_16M, GFP_2G, GFP_4G, GFP_36G, GFP_ATOMIC.

The 16M allocation descriptor will also point "back" to the 1M
allocation descriptor. Thus drivers requesting memory "below 16M"
will prefer to use memory between 1M and 16M because that's first
on the list.

I think that this will simplify things in the long run.

                                Roger.

-- 
** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2600998 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
* The Worlds Ecosystem is a stable system. Stable systems may experience *
* excursions from the stable situation. We are currently in such an      * 
* excursion: The stable situation does not include humans. ***************
-
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/



This archive was generated by hypermail 2b29 : Fri Mar 07 2003 - 22:00:25 EST