Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 35586
b: refs/heads/master
c: fb0e794
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed Sep 26, 2006
1 parent 1be4cb5 commit 8e16026
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2f1b6248682f8b39ca3c7e549dfc216d26c4109b
refs/heads/master: fb0e7942bdcbbd2f90e61cb4cfa4fa892a873f8a
9 changes: 0 additions & 9 deletions trunk/arch/ia64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,6 @@ config IA64_UNCACHED_ALLOCATOR
bool
select GENERIC_ALLOCATOR

config DMA_IS_DMA32
bool
default y

config DMA_IS_NORMAL
bool
depends on IA64_SGI_SN2
default y

config AUDIT_ARCH
bool
default y
Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/x86_64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ config X86
bool
default y

config ZONE_DMA32
bool
default y

config LOCKDEP_SUPPORT
bool
default y
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/gfp.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct vm_area_struct;
/* Zone modifiers in GFP_ZONEMASK (see linux/mmzone.h - low three bits) */
#define __GFP_DMA ((__force gfp_t)0x01u)
#define __GFP_HIGHMEM ((__force gfp_t)0x02u)
#ifdef CONFIG_DMA_IS_DMA32
#ifndef CONFIG_ZONE_DMA32
#define __GFP_DMA32 ((__force gfp_t)0x01) /* ZONE_DMA is ZONE_DMA32 */
#elif BITS_PER_LONG < 64
#define __GFP_DMA32 ((__force gfp_t)0x00) /* ZONE_NORMAL is ZONE_DMA32 */
Expand Down
16 changes: 13 additions & 3 deletions trunk/include/linux/mmzone.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,14 @@ enum zone_type {
* <16M.
*/
ZONE_DMA,
#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,
#endif
/*
* Normal addressable memory is in ZONE_NORMAL. DMA operations can be
* performed on pages in ZONE_NORMAL if the DMA devices support
Expand Down Expand Up @@ -161,9 +163,13 @@ enum zone_type {
*
* NOTE! Make sure this matches the zones in <linux/gfp.h>
*/
#define GFP_ZONEMASK 0x07
/* #define GFP_ZONETYPES (GFP_ZONEMASK + 1) */ /* Non-loner */
#define GFP_ZONETYPES ((GFP_ZONEMASK + 1) / 2 + 1) /* Loner */
#define GFP_ZONETYPES ((GFP_ZONEMASK + 1) / 2 + 1) /* Loner */

#ifdef CONFIG_ZONE_DMA32
#define GFP_ZONEMASK 0x07
#else
#define GFP_ZONEMASK 0x03
#endif

struct zone {
/* Fields commonly accessed by the page allocator */
Expand Down Expand Up @@ -429,7 +435,11 @@ static inline int is_normal(struct zone *zone)

static inline int is_dma32(struct zone *zone)
{
#ifdef CONFIG_ZONE_DMA32
return zone == zone->zone_pgdat->node_zones + ZONE_DMA32;
#else
return 0;
#endif
}

static inline int is_dma(struct zone *zone)
Expand Down
4 changes: 1 addition & 3 deletions trunk/include/linux/vmstat.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,10 @@ static inline unsigned long node_page_state(int node,
struct zone *zones = NODE_DATA(node)->node_zones;

return
#ifndef CONFIG_DMA_IS_NORMAL
#if !defined(CONFIG_DMA_IS_DMA32) && BITS_PER_LONG >= 64
#ifdef CONFIG_ZONE_DMA32
zone_page_state(&zones[ZONE_DMA32], item) +
#endif
zone_page_state(&zones[ZONE_NORMAL], item) +
#endif
#ifdef CONFIG_HIGHMEM
zone_page_state(&zones[ZONE_HIGHMEM], item) +
#endif
Expand Down
6 changes: 6 additions & 0 deletions trunk/mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ static void __free_pages_ok(struct page *page, unsigned int order);
*/
int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES-1] = {
256,
#ifdef CONFIG_ZONE_DMA32
256,
#endif
32
};

Expand All @@ -85,7 +87,9 @@ EXPORT_SYMBOL(zone_table);

static char *zone_names[MAX_NR_ZONES] = {
"DMA",
#ifdef CONFIG_ZONE_DMA32
"DMA32",
#endif
"Normal",
"HighMem"
};
Expand Down Expand Up @@ -1373,8 +1377,10 @@ static inline int highest_zone(int zone_bits)
int res = ZONE_NORMAL;
if (zone_bits & (__force int)__GFP_HIGHMEM)
res = ZONE_HIGHMEM;
#ifdef CONFIG_ZONE_DMA32
if (zone_bits & (__force int)__GFP_DMA32)
res = ZONE_DMA32;
#endif
if (zone_bits & (__force int)__GFP_DMA)
res = ZONE_DMA;
return res;
Expand Down

0 comments on commit 8e16026

Please sign in to comment.