]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
3a9934c6d3d3a2b7d50cfe4d23973b973d71e096
[thirdparty/kernel/stable-queue.git] /
1 From cc4a6851466039a8a688c843962a05689059ff3b Mon Sep 17 00:00:00 2001
2 From: Mel Gorman <mel@csn.ul.ie>
3 Date: Wed, 11 Nov 2009 14:26:14 -0800
4 Subject: page allocator: always wake kswapd when restarting an allocation attempt after direct reclaim failed
5
6 From: Mel Gorman <mel@csn.ul.ie>
7
8 commit cc4a6851466039a8a688c843962a05689059ff3b upstream.
9
10 If a direct reclaim makes no forward progress, it considers whether it
11 should go OOM or not. Whether OOM is triggered or not, it may retry the
12 allocation afterwards. In times past, this would always wake kswapd as
13 well but currently, kswapd is not woken up after direct reclaim fails.
14 For order-0 allocations, this makes little difference but if there is a
15 heavy mix of higher-order allocations that direct reclaim is failing for,
16 it might mean that kswapd is not rewoken for higher orders as much as it
17 did previously.
18
19 This patch wakes up kswapd when an allocation is being retried after a
20 direct reclaim failure. It would be expected that kswapd is already
21 awake, but this has the effect of telling kswapd to reclaim at the higher
22 order as well.
23
24 Signed-off-by: Mel Gorman <mel@csn.ul.ie>
25 Reviewed-by: Christoph Lameter <cl@linux-foundation.org>
26 Reviewed-by: Pekka Enberg <penberg@cs.helsinki.fi>
27 Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
28 Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
29 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
30 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
31
32 ---
33 mm/page_alloc.c | 2 +-
34 1 file changed, 1 insertion(+), 1 deletion(-)
35
36 --- a/mm/page_alloc.c
37 +++ b/mm/page_alloc.c
38 @@ -1763,6 +1763,7 @@ __alloc_pages_slowpath(gfp_t gfp_mask, u
39 if (NUMA_BUILD && (gfp_mask & GFP_THISNODE) == GFP_THISNODE)
40 goto nopage;
41
42 +restart:
43 wake_all_kswapd(order, zonelist, high_zoneidx);
44
45 /*
46 @@ -1772,7 +1773,6 @@ __alloc_pages_slowpath(gfp_t gfp_mask, u
47 */
48 alloc_flags = gfp_to_alloc_flags(gfp_mask);
49
50 -restart:
51 /* This is the last chance, in general, before the goto nopage. */
52 page = get_page_from_freelist(gfp_mask, nodemask, order, zonelist,
53 high_zoneidx, alloc_flags & ~ALLOC_NO_WATERMARKS,