lkml.org 
[lkml]   [2015]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] [RFC] mm/compaction: initialize compaction information
Date
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


\
 
 \ /
  Last update: 2015-03-19 07:01    [W:0.051 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site