Skip to content

Commit

Permalink
Revert "[PATCH] mm: micro optimise zone_watermark_ok"
Browse files Browse the repository at this point in the history
This reverts commit e80ee88.

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>
  • Loading branch information
Linus Torvalds committed Feb 1, 2007
1 parent f56df2f commit 6fd6b17
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6fd6b17

Please sign in to comment.