From: Peter Zijlstra Date: Tue, 16 Jun 2009 22:32:02 +0000 (-0700) Subject: page allocator: calculate the alloc_flags for allocation only once X-Git-Tag: v2.6.31-rc1~299^2~147 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=341ce06f69abfafa31b9468410a13dbd60e2b237;p=pandora-kernel.git page allocator: calculate the alloc_flags for allocation only once Factor out the mapping between GFP and alloc_flags only once. Once factored out, it only needs to be calculated once but some care must be taken. [neilb@suse.de says] As the test: - if (((p->flags & PF_MEMALLOC) || unlikely(test_thread_flag(TIF_MEMDIE))) - && !in_interrupt()) { - if (!(gfp_mask & __GFP_NOMEMALLOC)) { has been replaced with a slightly weaker one: + if (alloc_flags & ALLOC_NO_WATERMARKS) { Without care, this would allow recursion into the allocator via direct reclaim. This patch ensures we do not recurse when PF_MEMALLOC is set but TF_MEMDIE callers are now allowed to directly reclaim where they would have been prevented in the past. Signed-off-by: Peter Zijlstra Acked-by: Pekka Enberg Signed-off-by: Mel Gorman Cc: Neil Brown Cc: Christoph Lameter Cc: KOSAKI Motohiro Cc: Nick Piggin Cc: Dave Hansen Cc: Lee Schermerhorn Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed