From 6fd6b17c6d9713f56b5f20903ec3e00fa6cc435e Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Wed, 31 Jan 2007 16:43:36 -0800 Subject: Revert "[PATCH] mm: micro optimise zone_watermark_ok" This reverts commit e80ee884ae0e3794ef2b65a18a767d502ad712ee. Pawel Sikora had a boot-time oops due to it - because the sign change invalidates the following comparisons, since 'free_pages' can be negative. The micro-optimization just isn't worth it. Bisected-by: Pawel Sikora Acked-by: Andrew Morton Cc: Nick Piggin Signed-off-by: Linus Torvalds --- mm/page_alloc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'mm/page_alloc.c') diff --git a/mm/page_alloc.c b/mm/page_alloc.c index fc5b5442e94..2c606cc922a 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -989,8 +989,7 @@ int zone_watermark_ok(struct zone *z, int order, unsigned long mark, int classzone_idx, int alloc_flags) { /* free_pages my go negative - that's OK */ - unsigned long min = mark; - long free_pages = z->free_pages - (1 << order) + 1; + long min = mark, free_pages = z->free_pages - (1 << order) + 1; int o; if (alloc_flags & ALLOC_HIGH) -- cgit v1.2.3 From a25700a53f715fde30443e737e52310c6d4a311a Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Thu, 8 Feb 2007 14:20:40 -0800 Subject: [PATCH] mm: show bounce pages in oom killer output Also split that long line up - people like to send us wordwrapped oom-kill traces. Cc: Nick Piggin Cc: Christoph Lameter Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- mm/page_alloc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'mm/page_alloc.c') diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 2c606cc922a..f12052dc23f 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1579,8 +1579,8 @@ void show_free_areas(void) get_zone_counts(&active, &inactive, &free); - printk("Active:%lu inactive:%lu dirty:%lu writeback:%lu " - "unstable:%lu free:%u slab:%lu mapped:%lu pagetables:%lu\n", + printk("Active:%lu inactive:%lu dirty:%lu writeback:%lu unstable:%lu\n" + " free:%u slab:%lu mapped:%lu pagetables:%lu bounce:%lu\n", active, inactive, global_page_state(NR_FILE_DIRTY), @@ -1590,7 +1590,8 @@ void show_free_areas(void) global_page_state(NR_SLAB_RECLAIMABLE) + global_page_state(NR_SLAB_UNRECLAIMABLE), global_page_state(NR_FILE_MAPPED), - global_page_state(NR_PAGETABLE)); + global_page_state(NR_PAGETABLE), + global_page_state(NR_BOUNCE)); for_each_zone(zone) { int i; -- cgit v1.2.3