Skip to contentSkip to conversation

mem_notify v6: ignore very small zone for prevent incorrect low mem notify

PATCH In review KOSAKI Motohiro 1 participant 1 message Feb 9, 2008

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

PATCH 7/8 mem_notify v6: ignore very small zone for prevent incorrect low mem notify

on X86, ZONE_DMA is very very small.
it cause undesirable low mem notification.
It should ignored.

but on other some architecture, ZONE_DMA have 4GB. 4GB is large as it is not possible to ignored.

therefore, ignore or not is decided by zone size.

ChangeLog:

	v5: new
---
 include/linux/mem_notify.h |    3 +++
 mm/page_alloc.c            |    6 +++++-
 2 files changed, 8 insertions(+), 1 deletion(-)
include/linux/mem_notify.h +3 -0
Index: b/include/linux/mem_notify.h
===================================================================
@@ -22,6 +22,9 @@ static inline void memory_pressure_notif
 	unsigned long target;
 	unsigned long pages_high, pages_free, pages_reserve;
 
+	if (unlikely(zone->mem_notify_status == -1))
+		return;
+
 	if (pressure) {
 		target = atomic_long_read(&last_mem_notify) + MEM_NOTIFY_FREQ;
 		if (likely(time_before(jiffies, target)))
mm/page_alloc.c +5 -1
Index: b/mm/page_alloc.c
===================================================================
@@ -3470,7 +3470,11 @@ static void __meminit free_area_init_cor
 		zone->zone_pgdat = pgdat;
 
 		zone->prev_priority = DEF_PRIORITY;
-		zone->mem_notify_status = 0;
+
+		if (zone->present_pages < (pgdat->node_present_pages / 10))
+			zone->mem_notify_status = -1;
+		else
+			zone->mem_notify_status = 0;
 
 		zone_pcp_init(zone);
 		INIT_LIST_HEAD(&zone->active_list);