@@ -137,6 +137,13 @@ static inline void add_to_free_area_tail(struct page *page, struct free_area *ar
{
area->nr_free_treated++;
+#ifdef CONFIG_MEMORY_ISOLATION
+ /* Bypass membrane for isolated pages, all are considered "treated" */
+ if (migratetype == MIGRATE_ISOLATE) {
+ list_add(&page->lru, &area->free_list[migratetype]);
+ return;
+ }
+#endif
BUG_ON(area->treatment_mt != migratetype);
/* Insert page above membrane, then move membrane to the page */
@@ -1,6 +1,8 @@
// SPDX-License-Identifier: GPL-2.0
#include <linux/memory_aeration.h>
+#include <linux/mm.h>
#include <linux/mmzone.h>
+#include <linux/page-isolation.h>
#include <linux/gfp.h>
#include <linux/export.h>
#include <linux/delay.h>
@@ -83,8 +85,10 @@ static int __aerator_fill(struct zone *zone, unsigned int size)
* new raw pages can build. In the meantime move on
* to the next migratetype.
*/
- if (++mt >= MIGRATE_TYPES)
- mt = 0;
+ do {
+ if (++mt >= MIGRATE_TYPES)
+ mt = 0;
+ } while (is_migrate_isolate(mt));
/*
* Pull pages from free list until we have drained
@@ -989,7 +989,7 @@ static inline void __free_one_page(struct page *page,
set_page_order(page, order);
area = &zone->free_area[order];
- if (PageTreated(page)) {
+ if (is_migrate_isolate(migratetype) || PageTreated(page)) {
add_to_free_area_treated(page, area, migratetype);
return;
}