Commit 734f9246 authored by Nicolas Saenz Julienne's avatar Nicolas Saenz Julienne Committed by Catalin Marinas

mm: refresh ZONE_DMA and ZONE_DMA32 comments in 'enum zone_type'

These zones usage has evolved with time and the comments were outdated.
This joins both ZONE_DMA and ZONE_DMA32 explanation and gives up to date
examples on how they are used on different architectures.
Signed-off-by: default avatarNicolas Saenz Julienne <nsaenzjulienne@suse.de>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent 1a8e1cef
...@@ -359,33 +359,40 @@ struct per_cpu_nodestat { ...@@ -359,33 +359,40 @@ struct per_cpu_nodestat {
#endif /* !__GENERATING_BOUNDS.H */ #endif /* !__GENERATING_BOUNDS.H */
enum zone_type { enum zone_type {
#ifdef CONFIG_ZONE_DMA
/* /*
* ZONE_DMA is used when there are devices that are not able * ZONE_DMA and ZONE_DMA32 are used when there are peripherals not able
* to do DMA to all of addressable memory (ZONE_NORMAL). Then we * to DMA to all of the addressable memory (ZONE_NORMAL).
* carve out the portion of memory that is needed for these devices. * On architectures where this area covers the whole 32 bit address
* The range is arch specific. * space ZONE_DMA32 is used. ZONE_DMA is left for the ones with smaller
* DMA addressing constraints. This distinction is important as a 32bit
* DMA mask is assumed when ZONE_DMA32 is defined. Some 64-bit
* platforms may need both zones as they support peripherals with
* different DMA addressing limitations.
*
* Some examples:
*
* - i386 and x86_64 have a fixed 16M ZONE_DMA and ZONE_DMA32 for the
* rest of the lower 4G.
*
* - arm only uses ZONE_DMA, the size, up to 4G, may vary depending on
* the specific device.
*
* - arm64 has a fixed 1G ZONE_DMA and ZONE_DMA32 for the rest of the
* lower 4G.
* *
* Some examples * - powerpc only uses ZONE_DMA, the size, up to 2G, may vary
* depending on the specific device.
* *
* Architecture Limit * - s390 uses ZONE_DMA fixed to the lower 2G.
* ---------------------------
* parisc, ia64, sparc <4G
* s390, powerpc <2G
* arm Various
* alpha Unlimited or 0-16MB.
* *
* i386, x86_64 and multiple other arches * - ia64 and riscv only use ZONE_DMA32.
* <16M. *
* - parisc uses neither.
*/ */
#ifdef CONFIG_ZONE_DMA
ZONE_DMA, ZONE_DMA,
#endif #endif
#ifdef CONFIG_ZONE_DMA32 #ifdef CONFIG_ZONE_DMA32
/*
* x86_64 needs two ZONE_DMAs because it supports devices that are
* only able to do DMA to the lower 16M but also 32 bit devices that
* can only do DMA areas below 4G.
*/
ZONE_DMA32, ZONE_DMA32,
#endif #endif
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment