提交 6fd6b17c 编写于 作者: L Linus Torvalds

Revert "[PATCH] mm: micro optimise zone_watermark_ok"

This reverts commit e80ee884.

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: NPawel Sikora <pluto@agmk.net>
Acked-by: NAndrew Morton <akpm@osdl.org>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 f56df2f4
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册