linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [RFC] mm/compaction: initialize compaction information
@ 2015-03-19  5:30 Gioh Kim
  2015-03-19  8:41 ` Vlastimil Babka
  0 siblings, 1 reply; 9+ messages in thread
From: Gioh Kim @ 2015-03-19  5:30 UTC (permalink / raw)
  To: akpm, vbabka, rientjes, iamjoonsoo.kim, mgorman
  Cc: linux-mm, linux-kernel, gunho.lee, Gioh Kim

I tried to start compaction via /proc/sys/vm/compact_memory
as soon as I turned on my ARM-based platform.
But the compaction didn't start.
I found some variables in struct zone are not initalized.

I think zone->compact_cached_free_pfn and some cache values for compaction
are initalized when the kernel starts compaction, not via
/proc/sys/vm/compact_memory.
If my guess is correct, an initialization are needed for that case.


Signed-off-by: Gioh Kim <gioh.kim@lge.com>
---
 mm/compaction.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/mm/compaction.c b/mm/compaction.c
index 8c0d945..944a9cc 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -1299,6 +1299,14 @@ static int compact_zone(struct zone *zone, struct compact_control *cc)
 		__reset_isolation_suitable(zone);
 
 	/*
+	 * If this is activated by /proc/sys/vm/compact_memory
+	 * and the first try, cached information for compaction is not
+	 * initialized.
+	 */
+	if (cc->order == -1 && zone->compact_cached_free_pfn == 0)
+		__reset_isolation_suitable(zone);
+
+	/*
 	 * Setup to move all movable pages to the end of the zone. Used cached
 	 * information on where the scanners should start but check that it
 	 * is initialised by ensuring the values are within zone boundaries.
-- 
1.7.9.5

--
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 related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-03-21 11:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-19  5:30 [PATCH] [RFC] mm/compaction: initialize compaction information Gioh Kim
2015-03-19  8:41 ` Vlastimil Babka
2015-03-19  8:52   ` Gioh Kim
2015-03-19  9:01     ` Vlastimil Babka
2015-03-19 23:33       ` Gioh Kim
2015-03-20  7:51         ` Vlastimil Babka
2015-03-20 13:00         ` [PATCH][RFCv2] mm/compaction: reset compaction scanner positions Gioh Kim
2015-03-20 13:49           ` Vlastimil Babka
2015-03-21 11:53             ` Gioh Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).