linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gioh Kim <gioh.kim@lge.com>
To: Gioh Kim <gioh.kim@lge.com>,
	akpm@linux-foundation.org, rientjes@google.com,
	iamjoonsoo.kim@lge.com, mgorman@suse.de
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, gunho.lee@lge.com
Subject: [PATCH][RFCv2] mm/compaction: reset compaction scanner positions
Date: Fri, 20 Mar 2015 22:00:38 +0900	[thread overview]
Message-ID: <550C19F6.9080408@lge.com> (raw)
In-Reply-To: <550B5CD1.5010306@lge.com>

I'm attaching the patch for discussion.
According to Vlastimil's advice, I move the reseting before compact_zone(),
and write more description.

Vlastimil, can I have your name at Acked-by or Signed-off-by?
Which one do you prefer?

------------------------- 8< ----------------------

 From 575983c887e6478ca7cbba49a892dbc4cd69986b Mon Sep 17 00:00:00 2001
From: Gioh Kim <gioh.kim@lge.com>
Date: Fri, 20 Mar 2015 21:09:13 +0900
Subject: [PATCH] [RFCv2] mm/compaction: reset compaction scanner positions

When the compaction is activated via /proc/sys/vm/compact_memory
it would better scan the whole zone.
And some platform, for instance ARM, has the start_pfn of a zone as zero.
Therefore the first try to compaction via /proc doesn't work.
It needs to force to reset compaction scanner position at first.

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..ccf48ce 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -1587,6 +1587,14 @@ static void __compact_pgdat(pg_data_t *pgdat, struct compact_control *cc)
                 INIT_LIST_HEAD(&cc->freepages);
                 INIT_LIST_HEAD(&cc->migratepages);

+               /*
+                * When called via /proc/sys/vm/compact_memory
+                * this makes sure we compact the whole zone regardless of
+                * cached scanner positions.
+                */
+               if (cc->order == -1)
+                       __reset_isolation_suitable(zone);
+
                 if (cc->order == -1 || !compaction_deferred(zone, cc->order))
                         compact_zone(zone, cc);

--
1.7.9.5



  parent reply	other threads:[~2015-03-20 13:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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         ` Gioh Kim [this message]
2015-03-20 13:49           ` [PATCH][RFCv2] mm/compaction: reset compaction scanner positions 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=550C19F6.9080408@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 \
    /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;
as well as URLs for NNTP newsgroup(s).