[Devel] [PATCH RHEL7 COMMIT] ms/mm, compaction: terminate async compaction when rescheduling
Konstantin Khorenko
khorenko at virtuozzo.com
Wed Jan 31 18:22:01 MSK 2018
The commit is pushed to "branch-rh7-3.10.0-693.11.6.vz7.42.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-693.11.6.vz7.42.4
------>
commit 8339d32a00777f0fa1ef052def402cd41797f5bb
Author: David Rientjes <rientjes at google.com>
Date: Wed Jan 31 18:22:01 2018 +0300
ms/mm, compaction: terminate async compaction when rescheduling
Async compaction terminates prematurely when need_resched(), see
compact_checklock_irqsave(). This can never trigger, however, if the
cond_resched() in isolate_migratepages_range() always takes care of the
scheduling.
If the cond_resched() actually triggers, then terminate this pageblock
scan for async compaction as well.
Signed-off-by: David Rientjes <rientjes at google.com>
Acked-by: Mel Gorman <mgorman at suse.de>
Acked-by: Vlastimil Babka <vbabka at suse.cz>
Cc: Mel Gorman <mgorman at suse.de>
Cc: Vlastimil Babka <vbabka at suse.cz>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
(cherry picked from commit aeef4b83806f49a0c454b7d4578671b71045bee2)
Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
mm/compaction.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/mm/compaction.c b/mm/compaction.c
index 880c420f6ca3..35911b29683f 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -501,8 +501,13 @@ isolate_migratepages_range(struct zone *zone, struct compact_control *cc,
return 0;
}
+ if (cond_resched()) {
+ /* Async terminates prematurely on need_resched() */
+ if (cc->mode == MIGRATE_ASYNC)
+ return 0;
+ }
+
/* Time to isolate some pages for migration */
- cond_resched();
for (; low_pfn < end_pfn; low_pfn++) {
/* give a chance to irqs before checking need_resched() */
if (locked && !(low_pfn % SWAP_CLUSTER_MAX)) {
More information about the Devel
mailing list