Skip to contentSkip to conversation

New zone ZONE_EASY_RECLAIM take 3. (is_easy_reclaim func)[4/5]

PATCH New Yasunori Goto 1 participant 1 message Dec 10, 2005

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 New zone ZONE_EASY_RECLAIM take 3. (is_easy_reclaim func)[4/5]

This is for calculation of the watermark zone->pages_min/low/high. And it defines is_higher_zone().

include/linux/mmzone.h +15 -0
Index: zone_reclaim/include/linux/mmzone.h
===================================================================
@@ -394,6 +394,11 @@ static inline int populated_zone(struct 
 	return (!!zone->present_pages);
 }
 
+static inline int is_easy_reclaim_idx(int idx)
+{
+	return (idx == ZONE_EASY_RECLAIM);
+}
+
 static inline int is_highmem_idx(int idx)
 {
 	return (idx == ZONE_HIGHMEM);
@@ -410,11 +415,21 @@ static inline int is_normal_idx(int idx)
  *              to ZONE_{DMA/NORMAL/HIGHMEM/etc} in general code to a minimum.
  * @zone - pointer to struct zone variable
  */
+static inline int is_easy_reclaim(struct zone *zone)
+{
+	return zone == zone->zone_pgdat->node_zones + ZONE_EASY_RECLAIM;
+}
+
 static inline int is_highmem(struct zone *zone)
 {
 	return zone == zone->zone_pgdat->node_zones + ZONE_HIGHMEM;
 }
 
+static inline int is_higher_zone(struct zone *zone)
+{
+	return (is_highmem(zone) || is_easy_reclaim(zone));
+}
+
 static inline int is_normal(struct zone *zone)
 {
 	return zone == zone->zone_pgdat->node_zones + ZONE_NORMAL;
mm/page_alloc.c +2 -2
Index: zone_reclaim/mm/page_alloc.c
===================================================================
@@ -2573,7 +2573,7 @@ void setup_per_zone_pages_min(void)
 
 	/* Calculate total number of !ZONE_HIGHMEM pages */
 	for_each_zone(zone) {
-		if (!is_highmem(zone))
+		if (!is_higher_zone(zone))
 			lowmem_pages += zone->present_pages;
 	}
 
@@ -2581,7 +2581,7 @@ void setup_per_zone_pages_min(void)
 		unsigned long tmp;
 		spin_lock_irqsave(&zone->lru_lock, flags);
 		tmp = (pages_min * zone->present_pages) / lowmem_pages;
-		if (is_highmem(zone)) {
+		if (is_higher_zone(zone)) {
 			/*
 			 * __GFP_HIGH and PF_MEMALLOC allocations usually don't
 			 * need highmem pages, so cap pages_min to a small
Signature · 8 lines
Yasunori Goto 


--
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>