linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: stop kswapd's infinite loop at high order allocation
@ 2008-12-30 10:55 KOSAKI Motohiro
  2008-12-30 11:10 ` Nick Piggin
  2008-12-30 18:59 ` Mel Gorman
  0 siblings, 2 replies; 20+ messages in thread
From: KOSAKI Motohiro @ 2008-12-30 10:55 UTC (permalink / raw)
  To: LKML, linux-mm, Andrew Morton, Nick Piggin, wassim dagash; +Cc: kosaki.motohiro


ok, wassim confirmed this patch works well.


==
From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Subject: [PATCH] mm: kswapd stop infinite loop at high order allocation

Wassim Dagash reported following kswapd infinite loop problem.

  kswapd runs in some infinite loop trying to swap until order 10 of zone
  highmem is OK, While zone higmem (as I understand) has nothing to do
  with contiguous memory (cause there is no 1-1 mapping) which means
  kswapd will continue to try to balance order 10 of zone highmem
  forever (or until someone release a very large chunk of highmem).

He proposed remove contenious checking on highmem at all.
However hugepage on highmem need contenious highmem page.

To add infinite loop stopper is simple and good.



Reported-by: wassim dagash <wassim.dagash@gmail.com>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
---
 mm/vmscan.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

Index: b/mm/vmscan.c
===================================================================
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1872,6 +1872,17 @@ out:
 
 		try_to_freeze();
 
+		/*
+		 * When highmem is very fragmented,
+		 * alloc_pages(GFP_KERNEL, very-high-order) can cause
+		 * infinite loop because zone_watermark_ok(highmem) failed.
+		 * However, alloc_pages(GFP_KERNEL..) indicate highmem memory
+		 * continuousness isn't necessary.
+		 * Therefore we don't want contenious check at 2nd loop.
+		 */
+		if (nr_reclaimed < SWAP_CLUSTER_MAX)
+			order = sc.order = 0;
+
 		goto loop_again;
 	}
 


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2009-01-02 11:18 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-30 10:55 [PATCH] mm: stop kswapd's infinite loop at high order allocation KOSAKI Motohiro
2008-12-30 11:10 ` Nick Piggin
2008-12-30 18:59 ` Mel Gorman
2008-12-31  1:32   ` Nick Piggin
2008-12-31 11:06     ` Mel Gorman
2008-12-31 11:16       ` Nick Piggin
2008-12-31 12:11         ` Mel Gorman
2008-12-31  4:54   ` KOSAKI Motohiro
2008-12-31  8:59     ` wassim dagash
2008-12-31 12:05       ` Mel Gorman
2008-12-31 12:24         ` wassim dagash
2008-12-31 11:53     ` Mel Gorman
2008-12-31 13:34       ` KOSAKI Motohiro
2009-01-01 14:52         ` [PATCH] mm: stop kswapd's infinite loop at high order allocation take2 KOSAKI Motohiro
2009-01-02  9:55           ` MinChan Kim
2009-01-02 10:00             ` KOSAKI Motohiro
2009-01-02 10:29               ` MinChan Kim
2009-01-02 10:54                 ` KOSAKI Motohiro
2009-01-02 11:18                   ` MinChan Kim
2009-01-02 11:14           ` Mel Gorman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox