diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-01-31 19:43:36 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-01-31 19:46:40 -0500 |
commit | 6fd6b17c6d9713f56b5f20903ec3e00fa6cc435e (patch) | |
tree | f5dd7477e48fc5a1184d3472548291397be9c2b5 | |
parent | f56df2f4db6e4af87fb8e941cff69f4501a111df (diff) |
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 <pluto@agmk.net>
Acked-by: Andrew Morton <akpm@osdl.org>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | mm/page_alloc.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index fc5b5442e942..2c606cc922a5 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, | |||
989 | int classzone_idx, int alloc_flags) | 989 | int classzone_idx, int alloc_flags) |
990 | { | 990 | { |
991 | /* free_pages my go negative - that's OK */ | 991 | /* free_pages my go negative - that's OK */ |
992 | unsigned long min = mark; | 992 | long min = mark, free_pages = z->free_pages - (1 << order) + 1; |
993 | long free_pages = z->free_pages - (1 << order) + 1; | ||
994 | int o; | 993 | int o; |
995 | 994 | ||
996 | if (alloc_flags & ALLOC_HIGH) | 995 | if (alloc_flags & ALLOC_HIGH) |