linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Gioh Kim <gioh.kim@lge.com>
To: akpm@linux-foundation.org, vbabka@suse.cz, rientjes@google.com,
	iamjoonsoo.kim@lge.com, mgorman@suse.de
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	gunho.lee@lge.com, Gioh Kim <gioh.kim@lge.com>
Subject: [PATCH] [RFC] mm/compaction: initialize compaction information
Date: Thu, 19 Mar 2015 14:30:31 +0900	[thread overview]
Message-ID: <1426743031-30096-1-git-send-email-gioh.kim@lge.com> (raw)

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>

             reply	other threads:[~2015-03-19  5:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19  5:30 Gioh Kim [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1426743031-30096-1-git-send-email-gioh.kim@lge.com \
    --to=gioh.kim@lge.com \
    --cc=akpm@linux-foundation.org \
    --cc=gunho.lee@lge.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=rientjes@google.com \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox