Skip to content

Optional ZONE_DMA V2

Christoph Lameter linux-arch linux-ia64 linux-mm 1 version In review

Get series with b4
b4 am 20060918183614.19679.50359.sendpatchset@schroedinger.engr.sgi.com

Versions newest first

  1. v1 Latest8 patches 3 repliesIn review

V1->V2 from the cover letter

- Sh sh64 and parisc do not need ZONE_DMA so do not define CONFIG_ZONE_DMA for those zones. Add patches for those arches to remove the use of ZONE_DMA (untested since I do not have those arches).
- Update documentation after feedback from V1.

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8Deal with cases of ZONE_DMA meaning the first zoneinclude/linux/mm.h mm/mempolicy.c mm/page_alloc.c+6 -60 replies
2/8Introduce CONFIG_ZONE_DMAarch/cris/Kconfig arch/frv/Kconfig arch/h8300/Kconfig +6 more+35 -00 replies
3/8Optional ZONE_DMA in the VMinclude/linux/gfp.h include/linux/mmzone.h include/linux/slab.h +4 more+44 -60 replies
4/8Optional ZONE_DMA for i386arch/i386/Kconfig arch/i386/kernel/Makefile arch/i386/kernel/setup.c+16 -50 replies
5/8Optional ZONE_DMA for x86_64arch/x86_64/Kconfig arch/x86_64/kernel/Makefile arch/x86_64/mm/init.c+30 -120 replies
6/8Optional ZONE_DMA for ia64arch/ia64/Kconfig arch/ia64/mm/contig.c arch/ia64/mm/discontig.c+10 -20 replies
7/8Remove ZONE_DMA remains from pariscarch/parisc/Kconfig arch/parisc/mm/init.c+1 -60 replies
8/8Remove ZONE_DMA remains from sh/sh64arch/sh/mm/init.c arch/sh64/Kconfig arch/sh64/mm/init.c+1 -83 replies

Reviews trailers per patch

1 of 8 patches has a Reviewed-by or Acked-by.

PatchChristoph Hellwig
1/8A-b
2/8
3/8
4/8
5/8
6/8
7/8
8/8

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/8] Optional ZONE_DMA V2

Optional ZONE_DMA V2

V1->V2
- Sh sh64 and parisc do not need ZONE_DMA so do not define CONFIG_ZONE_DMA for those zones. Add patches for those arches to remove the use of ZONE_DMA (untested since I do not have those arches).
- Update documentation after feedback from V1.

This patch follows up on the earlier work in Andrew's tree to reduce the number of zones. The patches allow to go to a minimum of 2 zones. This one allows also to make ZONE_DMA optional and therefore the number of zones can be reduced to one.

ZONE_DMA is usually used for ISA DMA devices. There are a number of reasons why we would not want to have ZONE_DMA

1. Some arches do not need ZONE_DMA at all.

2. With the advent of IOMMUs DMA zones are no longer needed. The necessity of DMA zones may drastically be reduced in the future. This patchset allows a compilation of a kernel without that overhead.

3. Devices that require ISA DMA get rare these days. All my systems do not have any need for ISA DMA.

4. The presence of an additional zone unecessarily complicates VM operations because it must be scanned and balancing logic must operate on its.

5. With only ZONE_NORMAL one can reach the situation where we have only one zone. This will allow the unrolling of many loops in the VM and allows the optimization of varous code paths in the VM.

6. Having only a single zone in a NUMA system results in a 1-1 correspondence between nodes and zones. Various additional optimizations to critical VM paths become possible.

Many systems today can operate just fine with a single zone. If you look at what is in ZONE_DMA then one usually sees that nothing uses it. The DMA slabs are empty (Some arches use ZONE_DMA instead of ZONE_NORMAL, then ZONE_NORMAL will be empty instead).

On all of my systems (i386, x86_64, ia64) ZONE_DMA is completely empty. Why constantly look at an empty zone in /proc/zoneinfo and empty slab in /proc/slabinfo? Non i386 also frequently have no need for ZONE_DMA and zones stay empty.

The patchset was tested on i386 (UP / SMP), x86_64 (UP, NUMA) and ia64 (NUMA).

The RFC posted earlier (see
http://marc.theaimsgroup.com/?l=linux-kernel&m=115231723513008&w=2)
had lots of #ifdefs in them. An effort has been made to minize the number of #ifdefs and make this as compact as possible. The job was made much easier by the ongoing efforts of others to extract common arch specific functionality.

I have been running this for awhile now on my desktop and finally Linux is using all my available RAM instead of leaving the 16MB in ZONE_DMA untouched:

christoph@pentium940:~$ cat /proc/zoneinfo
Node 0, zone   Normal
  pages free     4435
        min      1448
        low      1810
        high     2172
        active   241786
        inactive 210170
        scanned  0 (a: 0 i: 0)
        spanned  524224
        present  524224
    nr_anon_pages 61680
    nr_mapped    14271
    nr_file_pages 390264
    nr_slab_reclaimable 27564
    nr_slab_unreclaimable 1793
    nr_page_table_pages 449
    nr_dirty     39
    nr_writeback 0
    nr_unstable  0
    nr_bounce    0
    cpu: 0 pcp: 0
              count: 156
              high:  186
              batch: 31
    cpu: 0 pcp: 1
              count: 9
              high:  62
              batch: 15
  vm stats threshold: 20
    cpu: 1 pcp: 0
              count: 177
              high:  186
              batch: 31
    cpu: 1 pcp: 1
              count: 12
              high:  62
              batch: 15
  vm stats threshold: 20
  all_unreclaimable: 0
  prev_priority:     12
  temp_priority:     12
  start_pfn:         0

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>