All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Mel Gorman <mgorman@techsingularity.net>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Vlastimil Babka <vbabka@suse.cz>
Subject: [PATCH 2/3] mm, compaction: split off flag for not updating skip hints
Date: Thu,  2 Nov 2017 13:17:05 +0100	[thread overview]
Message-ID: <20171102121706.21504-2-vbabka@suse.cz> (raw)
In-Reply-To: <20171102121706.21504-1-vbabka@suse.cz>

Pageblock skip hints were added as a heuristic for compaction, which shares
core code with CMA. Since CMA reliability would suffer from the heuristics,
compact_control flag ignore_skip_hint was added for the CMA use case.
Since commit 6815bf3f233e ("mm/compaction: respect ignore_skip_hint in
update_pageblock_skip") the flag also means that CMA won't *update* the skip
hints in addition to ignoring them.

Today, direct compaction can also ignore the skip hints in the last resort
attempt, but there's no reason not to set them when isolation fails in such
case. Thus, this patch splits off a new no_set_skip_hint flag to avoid the
updating, which only CMA sets. This should improve the heuristics a bit, and
allow us to simplify the persistent skip bit handling as the next step.

Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
---
 mm/compaction.c | 2 +-
 mm/internal.h   | 1 +
 mm/page_alloc.c | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/mm/compaction.c b/mm/compaction.c
index be7ab160f251..a92860d89679 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -294,7 +294,7 @@ static void update_pageblock_skip(struct compact_control *cc,
 	struct zone *zone = cc->zone;
 	unsigned long pfn;
 
-	if (cc->ignore_skip_hint)
+	if (cc->no_set_skip_hint)
 		return;
 
 	if (!page)
diff --git a/mm/internal.h b/mm/internal.h
index 0aaa05af7833..3e5dc95dc259 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -201,6 +201,7 @@ struct compact_control {
 	const int classzone_idx;	/* zone index of a direct compactor */
 	enum migrate_mode mode;		/* Async or sync migration mode */
 	bool ignore_skip_hint;		/* Scan blocks even if marked skip */
+	bool no_set_skip_hint;		/* Don't mark blocks for skipping */
 	bool ignore_block_suitable;	/* Scan blocks considered unsuitable */
 	bool direct_compaction;		/* False from kcompactd or /proc/... */
 	bool whole_zone;		/* Whole zone should/has been scanned */
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 67330a438525..79cdac1fee42 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -7577,6 +7577,7 @@ int alloc_contig_range(unsigned long start, unsigned long end,
 		.zone = page_zone(pfn_to_page(start)),
 		.mode = MIGRATE_SYNC,
 		.ignore_skip_hint = true,
+		.no_set_skip_hint = true,
 		.gfp_mask = current_gfp_context(gfp_mask),
 	};
 	INIT_LIST_HEAD(&cc.migratepages);
-- 
2.14.3

WARNING: multiple messages have this Message-ID (diff)
From: Vlastimil Babka <vbabka@suse.cz>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Mel Gorman <mgorman@techsingularity.net>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Vlastimil Babka <vbabka@suse.cz>
Subject: [PATCH 2/3] mm, compaction: split off flag for not updating skip hints
Date: Thu,  2 Nov 2017 13:17:05 +0100	[thread overview]
Message-ID: <20171102121706.21504-2-vbabka@suse.cz> (raw)
In-Reply-To: <20171102121706.21504-1-vbabka@suse.cz>

Pageblock skip hints were added as a heuristic for compaction, which shares
core code with CMA. Since CMA reliability would suffer from the heuristics,
compact_control flag ignore_skip_hint was added for the CMA use case.
Since commit 6815bf3f233e ("mm/compaction: respect ignore_skip_hint in
update_pageblock_skip") the flag also means that CMA won't *update* the skip
hints in addition to ignoring them.

Today, direct compaction can also ignore the skip hints in the last resort
attempt, but there's no reason not to set them when isolation fails in such
case. Thus, this patch splits off a new no_set_skip_hint flag to avoid the
updating, which only CMA sets. This should improve the heuristics a bit, and
allow us to simplify the persistent skip bit handling as the next step.

Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
---
 mm/compaction.c | 2 +-
 mm/internal.h   | 1 +
 mm/page_alloc.c | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/mm/compaction.c b/mm/compaction.c
index be7ab160f251..a92860d89679 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -294,7 +294,7 @@ static void update_pageblock_skip(struct compact_control *cc,
 	struct zone *zone = cc->zone;
 	unsigned long pfn;
 
-	if (cc->ignore_skip_hint)
+	if (cc->no_set_skip_hint)
 		return;
 
 	if (!page)
diff --git a/mm/internal.h b/mm/internal.h
index 0aaa05af7833..3e5dc95dc259 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -201,6 +201,7 @@ struct compact_control {
 	const int classzone_idx;	/* zone index of a direct compactor */
 	enum migrate_mode mode;		/* Async or sync migration mode */
 	bool ignore_skip_hint;		/* Scan blocks even if marked skip */
+	bool no_set_skip_hint;		/* Don't mark blocks for skipping */
 	bool ignore_block_suitable;	/* Scan blocks considered unsuitable */
 	bool direct_compaction;		/* False from kcompactd or /proc/... */
 	bool whole_zone;		/* Whole zone should/has been scanned */
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 67330a438525..79cdac1fee42 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -7577,6 +7577,7 @@ int alloc_contig_range(unsigned long start, unsigned long end,
 		.zone = page_zone(pfn_to_page(start)),
 		.mode = MIGRATE_SYNC,
 		.ignore_skip_hint = true,
+		.no_set_skip_hint = true,
 		.gfp_mask = current_gfp_context(gfp_mask),
 	};
 	INIT_LIST_HEAD(&cc.migratepages);
-- 
2.14.3

--
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:[~2017-11-02 12:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-02 12:17 [PATCH 1/3] mm, compaction: extend pageblock_skip_persistent() to all compound pages Vlastimil Babka
2017-11-02 12:17 ` Vlastimil Babka
2017-11-02 12:17 ` Vlastimil Babka [this message]
2017-11-02 12:17   ` [PATCH 2/3] mm, compaction: split off flag for not updating skip hints Vlastimil Babka
2017-11-02 13:09   ` Mel Gorman
2017-11-02 13:09     ` Mel Gorman
2017-11-02 12:17 ` [PATCH 3/3] mm, compaction: remove unneeded pageblock_skip_persistent() checks Vlastimil Babka
2017-11-02 12:17   ` Vlastimil Babka
2017-11-02 13:04 ` [PATCH 1/3] mm, compaction: extend pageblock_skip_persistent() to all compound pages Mel Gorman
2017-11-02 13:04   ` Mel Gorman
2017-11-03 20:37 ` David Rientjes
2017-11-03 20:37   ` David Rientjes

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=20171102121706.21504-2-vbabka@suse.cz \
    --to=vbabka@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.