* + mm-compaction-update-pageblock-skip-when-first-migration-candidate-is-not-at-the-start-fix.patch added to mm-unstable branch
@ 2023-06-07 0:59 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2023-06-07 0:59 UTC (permalink / raw)
To: mm-commits, zhouchuyi, vbabka, raghavendra.kt, pedro.falcato,
pbonzini, mlevitsk, mhocko, jirislaby, mgorman, akpm
The patch titled
Subject: mm-compaction-update-pageblock-skip-when-first-migration-candidate-is-not-at-the-start-fix
has been added to the -mm mm-unstable branch. Its filename is
mm-compaction-update-pageblock-skip-when-first-migration-candidate-is-not-at-the-start-fix.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-compaction-update-pageblock-skip-when-first-migration-candidate-is-not-at-the-start-fix.patch
This patch will later appear in the mm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days
------------------------------------------------------
From: Mel Gorman <mgorman@techsingularity.net>
Subject: mm-compaction-update-pageblock-skip-when-first-migration-candidate-is-not-at-the-start-fix
Date: Fri, 2 Jun 2023 12:16:22 +0100
Vlastimil Babka pointed out the following problem with
mm-compaction-update-pageblock-skip-when-first-migration-candidate-is-not-at-the-start.patch
I wonder if this has an unintended side-effect that if we resume
isolate_migratepages_block() of a partially compacted pageblock
to finish it, test_and_set_skip() will now tell us to abort,
because we already set the skip bit in the previous call. This
would include the cc->finish_pageblock rescan cases.
He is correct and a partial rescan as implemented in "mm, compaction:
finish pageblocks on complete migration failure" would abort prematurely.
Test and set the skip bit when acquiring "exclusive access" to a pageblock
for migration but only abort if the calling context is not rescanning to
finish a pageblock.
This is a fix for the mmotm patch
mm-compaction-update-pageblock-skip-when-first-migration-candidate-is-not-at-the-start.patch
Link: https://lkml.kernel.org/r/20230602111622.swtxhn6lu2qwgrwq@techsingularity.net
Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Chuyi Zhou <zhouchuyi@bytedance.com>
Cc: Jiri Slaby <jirislaby@kernel.org>
Cc: Maxim Levitsky <mlevitsk@redhat.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Pedro Falcato <pedro.falcato@gmail.com>
Cc: Raghavendra K T <raghavendra.kt@amd.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/compaction.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
--- a/mm/compaction.c~mm-compaction-update-pageblock-skip-when-first-migration-candidate-is-not-at-the-start-fix
+++ a/mm/compaction.c
@@ -1069,11 +1069,17 @@ isolate_migratepages_block(struct compac
lruvec_memcg_debug(lruvec, page_folio(page));
- /* Try get exclusive access under lock */
+ /*
+ * Try get exclusive access under lock. If marked for
+ * skip, the scan is aborted unless the current context
+ * is a rescan to reach the end of the pageblock.
+ */
if (!skip_updated && valid_page) {
skip_updated = true;
- if (test_and_set_skip(cc, valid_page))
+ if (test_and_set_skip(cc, valid_page) &&
+ !cc->finish_pageblock) {
goto isolate_abort;
+ }
}
/*
_
Patches currently in -mm which might be from mgorman@techsingularity.net are
mm-compaction-ensure-rescanning-only-happens-on-partially-scanned-pageblocks.patch
mm-compaction-only-force-pageblock-scan-completion-when-skip-hints-are-obeyed.patch
mm-compaction-update-pageblock-skip-when-first-migration-candidate-is-not-at-the-start.patch
mm-compaction-update-pageblock-skip-when-first-migration-candidate-is-not-at-the-start-fix.patch
revert-revert-mm-compaction-fix-set-skip-in-fast_find_migrateblock.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-06-07 1:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-07 0:59 + mm-compaction-update-pageblock-skip-when-first-migration-candidate-is-not-at-the-start-fix.patch added to mm-unstable branch Andrew Morton
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.