From: Mel Gorman Date: Tue, 16 Jun 2009 22:31:59 +0000 (-0700) Subject: page allocator: calculate the preferred zone for allocation only once X-Git-Tag: v2.6.31-rc1~299^2~149 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5117f45d11a9ee62d9b086f1312f3f31781ff155;p=pandora-kernel.git page allocator: calculate the preferred zone for allocation only once get_page_from_freelist() can be called multiple times for an allocation. Part of this calculates the preferred_zone which is the first usable zone in the zonelist but the zone depends on the GFP flags specified at the beginning of the allocation call. This patch calculates preferred_zone once. It's safe to do this because if preferred_zone is NULL at the start of the call, no amount of direct reclaim or other actions will change the fact the allocation will fail. [akpm@linux-foundation.org: remove (void) casts] Signed-off-by: Mel Gorman Reviewed-by: KOSAKI Motohiro Reviewed-by: Pekka Enberg Cc: Christoph Lameter Cc: Peter Zijlstra Cc: Nick Piggin Cc: Dave Hansen Cc: Lee Schermerhorn Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed