aboutsummaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorSteven Rostedt (VMware) <rostedt@goodmis.org>2017-11-17 14:21:04 -0500
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2017-11-17 14:21:04 -0500
commit96e80af2abe243828fcc2c838af753cc5e819169 (patch)
treea60c36939be889cb280a8ef27555b13d81066a61 /mm
parent864944c679274c16ff01fb9beadf35d6bf52e7a9 (diff)
parentd59dabdc4cb380b79c965af28cd4ba001f04834b (diff)
Merge tag 'v4.9.52' into v4.9-rt
This is the 4.9.52 stable release Conflicts: block/blk-core.c
Diffstat (limited to 'mm')
-rw-r--r--mm/page_alloc.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index a63aa41760af..6a187c2adcc9 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2139,13 +2139,25 @@ static void unreserve_highatomic_pageblock(const struct alloc_context *ac)
continue;
/*
- * It should never happen but changes to locking could
- * inadvertently allow a per-cpu drain to add pages
- * to MIGRATE_HIGHATOMIC while unreserving so be safe
- * and watch for underflows.
+ * In page freeing path, migratetype change is racy so
+ * we can counter several free pages in a pageblock
+ * in this loop althoug we changed the pageblock type
+ * from highatomic to ac->migratetype. So we should
+ * adjust the count once.
*/
- zone->nr_reserved_highatomic -= min(pageblock_nr_pages,
- zone->nr_reserved_highatomic);
+ if (get_pageblock_migratetype(page) ==
+ MIGRATE_HIGHATOMIC) {
+ /*
+ * It should never happen but changes to
+ * locking could inadvertently allow a per-cpu
+ * drain to add pages to MIGRATE_HIGHATOMIC
+ * while unreserving so be safe and watch for
+ * underflows.
+ */
+ zone->nr_reserved_highatomic -= min(
+ pageblock_nr_pages,
+ zone->nr_reserved_highatomic);
+ }
/*
* Convert to ac->migratetype and avoid the normal