mm: is_dma_zone
Subsystems (3)
PATCH 1/1 mm: is_dma_zone
Add a simple is_dma helper function to remain consistent with respect to avoiding the use of ZONE_* outside the headers.
include/linux/mmzone.h | 5 +++++ mm/swap_prefetch.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-)
---
include/linux/mmzone.h +5 -0
@@ -425,6 +425,11 @@ static inline int is_normal(struct zonereturn zone == zone->zone_pgdat->node_zones +ZONE_NORMAL ; } +static inline int is_dma (struct zone *zone) +{ +return zone == zone->zone_pgdat->node_zones +ZONE_DMA ; +} +/* These two functions are used to setup the per zone pages min values */ struct ctl_table ;struct file ;
mm/swap_prefetch.c +1 -1
@@ -180,7 +180,7 @@ static struct page *prefetch_get_page(vocontinue ;/* We don't prefetch into DMA */ -if (zone_idx (z) ==ZONE_DMA ) +if (is_dma (z))continue ; free = z->free_pages;
--
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>
include/linux/mmzone.h static inline int is_normal(struct zone · line 431
Quoted 4 lines · Con Kolivas
include/linux/mmzone.h +4
-0+static inline int is_dma (struct zone *zone) +{ +return zone == zone->zone_pgdat->node_zones +ZONE_DMA ; +}
Any reason you can't just use 'zone_idx(z) == ZONE_DMA' here, just like the code you replaced?
-- Dave
--
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>
Quoted 8 lines · Dave Hansen
include/linux/mmzone.h static inline int is_normal(struct zone · line 431
Quoted 4 lines · Con Kolivas
include/linux/mmzone.h +4
-0+static inline int is_dma (struct zone *zone) +{ +return zone == zone->zone_pgdat->node_zones +ZONE_DMA ; +}Any reason you can't just use '
zone_idx(z)==ZONE_DMA' here, just like the code you replaced?
I was just following the style of the is_highmem and is_normal immediately preceeding this. No strong reason otherwise.
Cheers,
Con
--
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>